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

CmsSigner() public method

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

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

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. /// /// is a zero-length string, contains only white space, or /// contains one or more invalid characters as defined by /// . /// /// is an invalid file path. /// /// The specified file path could not be found. /// /// The user does not have access to read the specified file. /// /// An I/O error occurred. ///
public CmsSigner ( string fileName, string password ) : System
fileName string The raw certificate and key data in pkcs12 format.
password string The password to unlock the stream.
return System
		public CmsSigner (string fileName, string password) : this ()
		{
			if (fileName == null)
				throw new ArgumentNullException ("fileName");

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

			using (var stream = File.OpenRead (fileName))
				LoadPkcs12 (stream, password);
		}
#endif

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 ( X509Certificate certificate, AsymmetricKeyParameter key ) : System