Cms Signer(Stream, String, Subject Identifier Type) Constructor
Initialize a new instance of the CmsSigner class.
Definition
Namespace: MimeKit.Cryptography
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
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.
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.
Exceptions
| ArgumentNullException |
stream is . -or- password is . |
| 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. |