The TScCMSEnvelopedData class represents a CMS/PKCS #7 structure for enveloped data, described in RFC 5652.

TScCMSEnvelopedData stores the required information and enables encrypting and decrypting of CMS/PKCS #7 messages.


To encrypt content of any type, in the beginning initialize the TScCMSEnvelopedData object with the required content using the Init method. After this, for each recipient, create and initialize the TScCMSRecipient object specifying a recipient's certificate with a public key, and encrypt the information using the Encrypt method. And finally, call the Encode method to get an encoded CMS message.


To decrypt CMS/PKCS #7 message, in the beginning, decode the message using the Decode method. This method sets all properties of the TScCMSEnvelopedData object by using the decoded message and a user can retrieve the required properties. The inner contents of the decoded message can be retrieved from the ContentInfo property, but the information will be encrypted. To decrypt the content data use the Decrypt method specifying the recipient's certificate with a private key.


See Also





SecureBridge Components, Copyright © 2007-2021 Devart. All Rights Reserved. Provide Feedback Visit Forum Request Support