Click or drag to resize
MimeKit

CmsSigner(Stream, String, SubjectIdentifierType) Constructor

Initialize a new instance of the CmsSigner class.

Namespace: MimeKit.Cryptography
Assembly: MimeKit (in MimeKit.dll) Version: 4.3.0
Syntax
C#
public CmsSigner(
	Stream stream,
	string password,
	SubjectIdentifierType signerIdentifierType = SubjectIdentifierType.IssuerAndSerialNumber
)

Parameters

stream  Stream
The raw certificate and key data in pkcs12 format.
password  String
The password to unlock the stream.
signerIdentifierType  SubjectIdentifierType  (Optional)
The scheme used for identifying the signer certificate.
Exceptions
ExceptionCondition
ArgumentNullException

stream is null.

-or-

password is null.

ArgumentException

stream does not contain a private key.

-or-

stream does not contain a certificate that could be used for signing.

IOException An I/O error occurred.
Remarks

Creates a new CmsSigner, loading the X.509 certificate and private key from the specified stream.

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