Discuss this help topic in SecureBlackbox Forum
XML: Use raw keys for signing
To sign using RSA / DSA / ECDSA / GOST raw key you would need to
C#:
Signer.SignatureMethodType = TElXMLSigMethodType.xmtSig;
Signer.SignatureMethod = TElXMLSignatureMethod.xsmRSA_SHA256;
TElXMLKeyInfoRSAData RSAKeyData = new TElXMLKeyInfoRSAData(true);
RSAKeyData.RSAKeyMaterial.Passphrase = "password";
RSAKeyData.RSAKeyMaterial.LoadSecret(FileStream);
Signer.KeyData = RSAKeyData;
Delphi:
Signer.SignatureMethodType := xmtSig;
Signer.SignatureMethod := xsmRSA_SHA256; // using RSA with SHA 256-bit
...
RSAKeyData := TElXMLKeyInfoRSAData.Create(True);
RSAKeyData.RSAKeyMaterial.Passphrase := 'password';
RSAKeyData.RSAKeyMaterial.LoadSecret(FileStream);
Signer.KeyData := RSAKeyData;
...
// when signing is finished we need to clear KeyData object
RSAKeyData.Free();