MimeKit.Cryptography.CmsSigner.CmsSigner C# (CSharp) Method

CmsSigner() public method

Initializes a new instance of the MimeKit.Cryptography.CmsSigner class.

The initial value of the MimeKit.Cryptography.DigestAlgorithm will be set to MimeKit.Cryptography.DigestAlgorithm.Sha1 and both the SignedAttributes and UnsignedAttributes properties will be initialized to empty tables.

/// is null. /// -or- /// is null. /// /// cannot be used for signing. /// -or- /// is not a private key. ///
public CmsSigner ( X509Certificate certificate, AsymmetricKeyParameter key ) : System
certificate Org.BouncyCastle.X509.X509Certificate The signer's certificate.
key Org.BouncyCastle.Crypto.AsymmetricKeyParameter The signer's private key.
return System
		public CmsSigner (X509Certificate certificate, AsymmetricKeyParameter key) : this ()
		{
			if (certificate == null)
				throw new ArgumentNullException ("certificate");

			CheckCertificateCanBeUsedForSigning (certificate);

			if (key == null)
				throw new ArgumentNullException ("key");

			if (!key.IsPrivate)
				throw new ArgumentException ("The key must be a private key.", "key");

			CertificateChain = new X509CertificateChain ();
			CertificateChain.Add (certificate);
			Certificate = certificate;
			PrivateKey = key;
		}

Same methods

CmsSigner::CmsSigner ( ) : System
CmsSigner::CmsSigner ( IEnumerable chain, AsymmetricKeyParameter key ) : System
CmsSigner::CmsSigner ( System.Stream stream, string password ) : System
CmsSigner::CmsSigner ( System.Security.Cryptography.X509Certificates.X509Certificate2 certificate ) : System
CmsSigner::CmsSigner ( string fileName, string password ) : System