Click or drag to resize
MimeKit

CmsSigner(IEnumerableX509Certificate, AsymmetricKeyParameter, SubjectIdentifierType) Constructor

Initialize a new instance of the CmsSigner class.

Namespace: MimeKit.Cryptography
Assembly: MimeKit (in MimeKit.dll) Version: 4.7.1
Syntax
C#
public CmsSigner(
	IEnumerable<X509Certificate> chain,
	AsymmetricKeyParameter key,
	SubjectIdentifierType signerIdentifierType = SubjectIdentifierType.IssuerAndSerialNumber
)

Parameters

chain  IEnumerableX509Certificate
The chain of certificates starting with the signer's certificate back to the root.
key  AsymmetricKeyParameter
The signer's private key.
signerIdentifierType  SubjectIdentifierType  (Optional)
The scheme used for identifying the signer certificate.
Exceptions
ExceptionCondition
ArgumentNullException

chain is null.

-or-

key is null.

ArgumentException

chain did not contain any certificates.

-or-

The certificate cannot be used for signing.

-or-

key is not a private key.

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.

See Also