System.Security 2.0.0.0 4.0.0.0 System.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

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

- Constructor
  2.0.0.0
  4.0.0.0

  The class has the following default property values.

  Property

  Default value

  1.2.840.113549.1.7.1 (data)Length: zero

  Detached state: false The content that is signed is included in the CMS/PKCS #7 message along with the signature information.

  The default for signers is SubjectIdentifierType.IssuerAndSerialNumber.

  If the detached state is false (the default), the signed content is included in the CMS/PKCS #7 message along with the signature information. If the detached state is true, clients that cannot decode S/MIME messages can still see the content of the message if it is sent separately. This may be useful in an archiving application that archives message content whether the message sender can be verified for authenticity.

  The constructor creates an instance of the class.

- Constructor
  2.0.0.0
  4.0.0.0
  To be added.

  For the default property values used with this constructor, see .

  If the detached state is false (the default), the content that is signed is included in the CMS/PKCS #7 message along with the signature information. If the detached state is true, clients that cannot decode S/MIME messages can still see the content of the message if it is sent separately. This might be useful in an archiving application that archives message content whether the message sender can be verified for authenticity.

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

- Constructor
  2.0.0.0
  4.0.0.0

  For the default property values used with this constructor, see .

  If the detached state is false (the default), the content that is signed is included in the CMS/PKCS #7 message along with the signature information. If the detached state is true, clients that cannot decode S/MIME messages can still see the content of the message if it is sent separately. This might be useful in an archiving application that archives message content whether the message sender can be verified for authenticity.

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

  A member that specifies the default subject identifier type for signers.
- Constructor
  2.0.0.0
  4.0.0.0
  To be added.

  For the default property values used with this constructor, see .

  If the detached state is false (the default), the content that is signed is included in the CMS/PKCS #7 message along with the signature information. If the detached state is true, clients that cannot decode S/MIME messages can still see the content of the message if it is sent separately. This might be useful in an archiving application that archives message content whether the message sender can be verified for authenticity.

  The constructor creates an instance of the class by using the specified content information as the inner content and by using the detached state.

  A value that specifies whether the object is for a detached signature. If is true, the signature is detached. If is false, the signature is not detached.
- Constructor
  2.0.0.0
  4.0.0.0
  To be added.

  For the default property values used with this constructor, see .

  If the detached state is false (the default), the content that is signed is included in the CMS/PKCS #7 message along with the signature information. If the detached state is true, clients that cannot decode S/MIME messages can still see the content of the message if it is sent separately. This might be useful in an archiving application that archives message content whether the message sender can be verified for authenticity.

  The constructor creates an instance of the class by using the specified subject identifier type as the default subject identifier type for signers and content information as the inner content.

  A member that specifies the default subject identifier type for signers.
- Constructor
  2.0.0.0
  4.0.0.0
  To be added.

  If the detached state is false (the default), the content that is signed is included in the CMS/PKCS #7 message along with the signature information. If the detached state is true, clients that cannot decode S/MIME messages can still see the content of the message if it is sent separately. This may be useful in an archiving application that archives message content whether or not the message sender can be verified for authenticity.

  The constructor creates an instance of the 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.

  A member that specifies the default subject identifier type for signers.
  A value that specifies whether the object is for a detached signature. If is true, the signature is detached. If detached is false, the signature is not detached.
- Property
  2.0.0.0
  4.0.0.0
  System.Security.Cryptography.X509Certificates.X509Certificate2Collection To be added. To be added.

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

- Method
  2.0.0.0
  4.0.0.0
  System.Void

  This method does not provide authentication of the CMS/PKCS #7 message.

  The method verifies the data integrity of the CMS/PKCS #7 message. 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. 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 or methods.

- Method
  2.0.0.0
  4.0.0.0
  System.Void ``

  This method verifies all signatures, including countersignatures, on the CMS/PKCS #7 message. If there are signed attributes included with the message, these attributes are also verified. If the option is chosen to validate certificates, the entire included portion of the certificate chain is validated.

  This method throws an exception if the verification of a digital signature fails or any validation requirements are not met.

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

  A value that specifies whether only the digital signatures are verified without the signers' certificates being validated.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  This method verifies all signatures, including countersignatures, on the CMS/PKCS #7 message. If there are signed attributes included with the message, these attributes are also verified. If the option is chosen to validate certificates, the entire included portion of the certificate chain is validated.

  This method throws an exception if the verification of a digital signature fails or any validation requirements are not met.

  The 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.

  An object that can be used to validate the certificate chain. If no additional certificates are to be used to validate the certificate chain, use instead of . A value that specifies whether only the digital signatures are verified without the signers' certificates being validated.
- Method
  2.0.0.0
  4.0.0.0
  System.Void

  This method displays a user interface in which you choose signers for this message. This requires that the current process is running in user interactive mode, meaning that the property is set to true. A process is normally in user interactive mode unless it is a service process or running inside a Web application.

  Signers whose certificates meet the following conditions will be displayed in the list:

  The certificate has an associated private key.

  The certificate is within its validity period.

  The certificate has no key usage or a key usage that supports digital signatures or nonrepudiation.

  Signer certificates are chosen from the My store.

  ## .NET Framework Security

  The following permissions are required to display the user interface:

  The following permissions are required to access the signature key:

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

- Method
  2.0.0.0
  4.0.0.0
  System.Void ``

  ## .NET Framework Security

  The following permissions are required to access the signature key:

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

  A object that represents the signer.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  ## .NET Framework Security

  The following permissions are required to display the user interface:

  The following permissions are required to access the signature key:

  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 property of the object specified by the signer parameter is not set to a valid certificate, this method prompts the user to select a signing certificate.

  A object that represents the signer. false to prompt the user to select a signing certificate.
- Property
  2.0.0.0
  4.0.0.0
  System.Security.Cryptography.Pkcs.ContentInfo To be added. To be added.

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

- Method
  2.0.0.0
  4.0.0.0
  System.Void ``

  This method resets all member variables of the object by using the information obtained from successful decoding.

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

  Array of byte values that represents the encoded CMS/PKCS #7 message to be decoded.
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added. To be added.

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

- Method
  2.0.0.0
  4.0.0.0
  System.Byte[] To be added.

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

  An array of byte values that represents the encoded message. The encoded message can be decoded by the method.

- Method
  2.0.0.0
  4.0.0.0
  System.Void `` To be added.

  Removes the signature at the specified index of the collection.

  The zero-based index of the signature to remove.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` To be added.

  The method removes the signature for the specified object.

  A object that represents the countersignature being removed.
- Property
  2.0.0.0
  4.0.0.0
  System.Security.Cryptography.Pkcs.SignerInfoCollection To be added. To be added.

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

- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  The version determines whether the message is a PKCS #7 message or a Cryptographic Message Syntax (CMS) message. CMS is a newer superset of PKCS #7.

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