SignedCms Class

SignedCms Class

 

The SignedCms class enables signing and verifying of CMS/PKCS #7 messages.

Namespace:   System.Security.Cryptography.Pkcs
Assembly:  System.Security (in System.Security.dll)

System.Object
  System.Security.Cryptography.Pkcs.SignedCms

[HostProtectionAttribute(SecurityAction.LinkDemand, MayLeakOnAbort = true)]
public sealed class SignedCms

NameDescription
System_CAPS_pubmethodSignedCms()

The SignedCms() constructor creates an instance of the SignedCms class.

System_CAPS_pubmethodSignedCms(ContentInfo)

The SignedCms(ContentInfo) constructor creates an instance of the SignedCms class by using the specified content information as the inner content.

System_CAPS_pubmethodSignedCms(ContentInfo, Boolean)

The SignedCms(ContentInfo, Boolean) constructor creates an instance of the SignedCms class by using the specified content information as the inner content and by using the detached state.

System_CAPS_pubmethodSignedCms(SubjectIdentifierType)

The SignedCms(SubjectIdentifierType) constructor creates an instance of the SignedCms class by using the specified subject identifier type as the default subject identifier type for signers.

System_CAPS_pubmethodSignedCms(SubjectIdentifierType, ContentInfo)

The SignedCms(SubjectIdentifierType, ContentInfo) constructor creates an instance of the SignedCms class by using the specified subject identifier type as the default subject identifier type for signers and content information as the inner content.

System_CAPS_pubmethodSignedCms(SubjectIdentifierType, ContentInfo, Boolean)

The SignedCms(SubjectIdentifierType, ContentInfo, Boolean) constructor creates an instance of the SignedCms class by using the specified subject identifier type as the default subject identifier type for signers, the content information as the inner content, and by using the detached state.

NameDescription
System_CAPS_pubpropertyCertificates

The Certificates property retrieves the certificates associated with the encoded CMS/PKCS #7 message.

System_CAPS_pubpropertyContentInfo

The ContentInfo property retrieves the inner contents of the encoded CMS/PKCS #7 message.

System_CAPS_pubpropertyDetached

The Detached property retrieves whether the SignedCms object is for a detached signature.

System_CAPS_pubpropertySignerInfos

The SignerInfos property retrieves the SignerInfoCollection collection associated with the CMS/PKCS #7 message.

System_CAPS_pubpropertyVersion

The Version property retrieves the version of the CMS/PKCS #7 message.

NameDescription
System_CAPS_pubmethodCheckHash()

The CheckHash method verifies the data integrity of the CMS/PKCS #7 message. CheckHash is a specialized method used in specific security infrastructure applications that only wish to check the hash of the CMS message, rather than perform a full digital signature verification. CheckHash does not authenticate the author nor sender of the message because this method does not involve verifying a digital signature. For general-purpose checking of the integrity and authenticity of a CMS/PKCS #7 message, use the CheckSignature(Boolean) or CheckSignature(X509Certificate2Collection, Boolean) methods.

System_CAPS_pubmethodCheckSignature(Boolean)

The CheckSignature(Boolean) method verifies the digital signatures on the signed CMS/PKCS #7 message and, optionally, validates the signers' certificates.

System_CAPS_pubmethodCheckSignature(X509Certificate2Collection, Boolean)

The CheckSignature(X509Certificate2Collection, Boolean) method verifies the digital signatures on the signed CMS/PKCS #7 message by using the specified collection of certificates and, optionally, validates the signers' certificates.

System_CAPS_pubmethodComputeSignature()

The ComputeSignature() method prompts the user to select a signing certificate, creates a signature, and adds the signature to the CMS/PKCS #7 message.

System_CAPS_pubmethodComputeSignature(CmsSigner)

The ComputeSignature(CmsSigner) method creates a signature using the specified signer and adds the signature to the CMS/PKCS #7 message.

System_CAPS_pubmethodComputeSignature(CmsSigner, Boolean)

Creates a signature using the specified signer and adds the signature to the CMS/PKCS #7 message. If the value of the silent parameter is false and the Certificate property of the CmsSigner object specified by the signer parameter is not set to a valid certificate, this method prompts the user to select a signing certificate.

System_CAPS_pubmethodDecode(Byte[])

The Decode method decodes an encoded SignedCms message. Upon successful decoding, the decoded information can be retrieved from the properties of the SignedCms object.

System_CAPS_pubmethodEncode()

The Encode method encodes the information in the object into a CMS/PKCS #7 message.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodRemoveSignature(Int32)

Removes the signature at the specified index of the SignerInfos collection.

System_CAPS_pubmethodRemoveSignature(SignerInfo)

The RemoveSignature method removes the signature for the specified SignerInfo object.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

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

.NET Framework
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft