MimeKit.Cryptography.CmsSigner.CmsSigner C# (CSharp) 메소드

CmsSigner() 공개 메소드

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. /// /// cannot be used for signing. ///
public CmsSigner ( System.Security.Cryptography.X509Certificates.X509Certificate2 certificate ) : System
certificate System.Security.Cryptography.X509Certificates.X509Certificate2 The signer's certificate.
리턴 System
		public CmsSigner (X509Certificate2 certificate) : this ()
		{
			if (certificate == null)
				throw new ArgumentNullException ("certificate");

			if (!certificate.HasPrivateKey)
				throw new ArgumentException ("The certificate does not contain a private key.", "certificate");

			var cert = DotNetUtilities.FromX509Certificate (certificate);
			var key = DotNetUtilities.GetKeyPair (certificate.PrivateKey);

			CheckCertificateCanBeUsedForSigning (cert);

			CertificateChain = new X509CertificateChain ();
			CertificateChain.Add (cert);
			Certificate = cert;
			PrivateKey = key.Private;
		}
#endif

Same methods

CmsSigner::CmsSigner ( ) : System
CmsSigner::CmsSigner ( IEnumerable chain, AsymmetricKeyParameter key ) : System
CmsSigner::CmsSigner ( System.Stream stream, string password ) : System
CmsSigner::CmsSigner ( X509Certificate certificate, AsymmetricKeyParameter key ) : System
CmsSigner::CmsSigner ( string fileName, string password ) : System