Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodTstCustomMPEnvelopedData.Encrypt

function Encrypt(aCert: iCertificate; aContent, aDest: TStream): Boolean; overload;
Producer side: encrypts aContent to the single recipient identified by the certificate aCert, writing the EnvelopedData to aDest. Pass nil to have OnAddRecipient supply the recipient certificate.
function Encrypt(aRecipientEMail: string; aContent, aDest: TStream): Boolean; overload;
Encrypts aContent to the recipient whose certificate is located by e-mail address in KeysAndCerts. If no certificate matches, CertificateNotFound is set and OnRecipientCertNotFound fires. Use this when addressing by e-mail (S/MIME style) rather than holding the certificate.
function Encrypt(aRecipientEMailList: TStrings; AContent, ADest: TStream): Boolean; overload;
Encrypts aContent to every recipient whose certificate is found by e-mail in the aRecipientEMailList; addresses with no matching certificate are skipped (firing OnRecipientCertNotFound). Fails only if not one recipient certificate could be resolved. Use this for multi-recipient enveloping.