CmsSigner(X509Certificate, AsymmetricKeyParameter, SubjectIdentifierType) Constructor

Initialize a new instance of the CmsSigner class.

Definition

Namespace: MimeKit.Cryptography
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
C#
public CmsSigner(
	X509Certificate certificate,
	AsymmetricKeyParameter key,
	SubjectIdentifierType signerIdentifierType = SubjectIdentifierType.IssuerAndSerialNumber
)

Parameters

certificate  X509Certificate
The signer's certificate.
key  AsymmetricKeyParameter
The signer's private key.
signerIdentifierType  SubjectIdentifierType  (Optional)
The scheme used for identifying the signer certificate.

Remarks

The initial value of the DigestAlgorithm will be set to Sha256 and both the SignedAttributes and UnsignedAttributes properties will be initialized to empty tables.

Exceptions

ArgumentNullException

certificate is .

-or-

key is .

ArgumentException

certificate cannot be used for signing.

-or-

key is not a private key.

See Also