Discuss this help topic in SecureBlackbox Forum
Use RSA keys, X.509 certificates or OpenPGP keys for encryption
X.509 certificates, OpenPGP keys and RSA keys can not be used to encrypt the data.
You need to create the session key to encrypt the data.
The session key itself can be encrypted and included with the encrypted data as described in the corresponding how-to article.
To encrypt the session key using public key algorithms, you need one of the following.
For RSA keys:
- create an instance of TElXMLKeyInfoRSAData class;
- load the RSA key to RSAKeyMaterial property of TElXMLKeyInfoRSAData class.
Note that you need only public key for encryption.
Private key is needed for decryption;
- assign the instance of TElXMLKeyInfoRSAData class to KeyEncryptionKeyData property of TElXMLEncProcessor class
For X.509 certificates:
- create an instance of TElXMLKeyInfoX509Data class;
- create an instance of TElX509Certificate class and assign it to Certificate property of TElXMLKeyInfoX509Data class;
- load the certificate (private key is not needed) to an instance of TElX509Certificate class;
- assign the instance of TElXMLKeyInfoX509Data class to KeyEncryptionKeyData property of TElXMLEncProcessor class
For OpenPGP keys:
- create an instance of TElXMLKeyInfoPGPData class;
- create an instance of TElPGPPublicKey class and assign it to PublicKey property of TElXMLKeyInfoPGPData class;
- load the OpenPGP public key to an instance of TElPGPPublicKey class;
- assign the instance of TElXMLKeyInfoPGPData class to KeyEncryptionKeyData property of TElXMLEncProcessor class
Discuss this help topic in SecureBlackbox Forum