Click or drag to resize
MimeKit

CmsSigner(String, String, 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(
	string fileName,
	string password,
	SubjectIdentifierType signerIdentifierType = SubjectIdentifierType.IssuerAndSerialNumber
)

Parameters

fileName  String
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

fileName is null.

-or-

password is null.

ArgumentException

fileName is a zero-length string, contains only white space, or contains one or more invalid characters.

-or-

fileName does not contain a private key.

-or-

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

DirectoryNotFoundExceptionfileName is an invalid file path.
FileNotFoundException The specified file path could not be found.
UnauthorizedAccessException The user does not have access to read the specified file.
IOException An I/O error occurred.
Remarks

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

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