Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodTstRSAPublicKey.Encrypt

function Encrypt(const aData : AnsiString; const aP : AnsiString = ''; aEncFormat : tStringFormat = sfBinary; aDataFormat: tStringFormat = sfBinary; aPFormat : tStringFormat = sfBinary) : AnsiString; overload;
RSAES-OAEP/PKCS#1v1.5 encryption to this component's public key (selected via EncryptEncoding); an application calls this to encrypt data/a key for the holder of the matching private key, e.g. wrapping a content-encryption key for CMS EnvelopedData/PKCS#12.
function Encrypt(const aData : iSecretKey; const aP : AnsiString = ''; aEncFormat : tStringFormat = sfBinary; aPFormat : tStringFormat = sfBinary) : AnsiString; overload;
Overload taking an iSecretKey (e.g. a freshly generated content-encryption key) directly, avoiding an intermediate AnsiString copy of the secret.