Edit

Share via


EnvelopedCms Class

Definition

Represents a CMS/PKCS#7 structure for enveloped data.

public ref class EnvelopedCms sealed
public sealed class EnvelopedCms
type EnvelopedCms = class
Public NotInheritable Class EnvelopedCms
Inheritance
EnvelopedCms

Remarks

The Cryptographic Message Syntax RFC specifies the following MIME types and file name extensions for CMS/PKCS#7 messages with these content types.

Content type MIME type Extension
envelopedData application/pkcs7-mime .p7m
signedData application/pkcs7-signature .p7s.p7c

Constructors

EnvelopedCms()

Initializes a new instance of the EnvelopedCms class with default values.

EnvelopedCms(ContentInfo)

Initializes a new instance of the EnvelopedCms class with specified content information.

EnvelopedCms(ContentInfo, AlgorithmIdentifier)

Initializes a new instance of the EnvelopedCms class with a specified symmetric encryption algorithm and content information.

EnvelopedCms(SubjectIdentifierType, ContentInfo)

Initializes a new instance of the EnvelopedCms class with specified content information and a subject identifier scheme when selecting recipients by UI.

EnvelopedCms(SubjectIdentifierType, ContentInfo, AlgorithmIdentifier)

Initializes a new instance of the EnvelopedCms class with specified a symmetric encryption algorithm, content information, and a subject identifier scheme when selecting recipients by UI.

Properties

Certificates

Gets the collection of certificates associated with the enveloped CMS/PKCS#7 message.

ContentEncryptionAlgorithm

Gets the identifier of the symmetric encryption algorithm associated with this message.

ContentInfo

Gets the content information for the enveloped CMS/PKCS#7 message.

RecipientInfos

Gets a collection that represents the recipients list for a decoded message. The default value is an empty collection.

UnprotectedAttributes

Gets the collection of unprotected (unencrypted) attributes associated with the enveloped CMS/PKCS#7 message.

Version

Gets the version of the decoded enveloped CMS/PKCS#7 message.

Methods

Decode(Byte[])

Decodes an array of bytes as a CMS/PKCS#7 EnvelopedData message.

Decode(ReadOnlySpan<Byte>)

Decodes the provided data as a CMS/PKCS#7 EnvelopedData message.

Decrypt()

Decrypts the contents of the decoded enveloped CMS/PKCS#7 message via any available recipient by searching certificate stores for a matching certificate and key.

Decrypt(RecipientInfo)

Decrypts the contents of the decoded enveloped CMS/PKCS#7 message via a specified recipient info by searching certificate stores for a matching certificate and key.

Decrypt(RecipientInfo, AsymmetricAlgorithm)

Decrypts the contents of the decoded enveloped CMS/PKCS#7 message via a specified recipient info with a specified private key.

Decrypt(RecipientInfo, X509Certificate2Collection)

Decrypts the contents of the decoded enveloped CMS/PKCS#7 message via a specified recipient info by searching certificate stores and a provided collection for a matching certificate and key.

Decrypt(X509Certificate2Collection)

Decrypts the contents of the decoded enveloped CMS/PKCS#7 message via any available recipient info by searching certificate stores and a provided collection for a matching certificate and key.

Encode()

Encodes the contents of the enveloped CMS/PKCS#7 message and returns it as a byte array.

Encrypt()

Encrypts the contents of the CMS/PKCS#7 message after selecting recipient certificates via a UI popup.

Encrypt(CmsRecipient)

Encrypts the contents of the CMS/PKCS#7 message for a single specified recipient.

Encrypt(CmsRecipientCollection)

Encrypts the contents of the CMS/PKCS#7 message for one or more recipients.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to