Cms Signer(IEnumerableX509Certificate, AsymmetricKeyParameter, 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(
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.
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 |
chain is . -or- key is . |
| ArgumentException |
chain did not contain any certificates. -or- The certificate cannot be used for signing. -or- key is not a private key. |