C# Class MimeKit.Cryptography.CmsSigner

An S/MIME signer.
If the X.509 certificate is known for the signer, you may wish to use a CmsSigner as opposed to having the CryptographyContext do its own certificate lookup for the signer's MailboxAddress.
Exibir arquivo Open project: nachocove/MimeKit Class Usage Examples

Public Methods

Method Description
CmsSigner ( IEnumerable chain, AsymmetricKeyParameter key ) : System

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

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

CmsSigner ( System.Stream stream, string password ) : System

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 stream.

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.

CmsSigner ( System.Security.Cryptography.X509Certificates.X509Certificate2 certificate ) : System

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.

CmsSigner ( X509Certificate certificate, AsymmetricKeyParameter key ) : System

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.

CmsSigner ( string fileName, string password ) : System

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.

Private Methods

Method Description
CheckCertificateCanBeUsedForSigning ( X509Certificate certificate ) : void
CmsSigner ( ) : System

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

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

LoadPkcs12 ( System.Stream stream, string password ) : void

Method Details

CmsSigner() public method

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

The initial value of the 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. /// /// did not contain any certificates. /// -or- /// The certificate cannot be used for signing. /// -or- /// is not a private key. ///
public CmsSigner ( IEnumerable chain, AsymmetricKeyParameter key ) : System
chain IEnumerable The chain of certificates starting with the signer's certificate back to the root.
key Org.BouncyCastle.Crypto.AsymmetricKeyParameter The signer's private key.
return System

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 stream.

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. /// /// does not contain a private key. /// /// An I/O error occurred. ///
public CmsSigner ( System.Stream stream, string password ) : System
stream System.Stream The raw certificate and key data in pkcs12 format.
password string The password to unlock the stream.
return System

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. /// /// cannot be used for signing. ///
public CmsSigner ( System.Security.Cryptography.X509Certificates.X509Certificate2 certificate ) : System
certificate System.Security.Cryptography.X509Certificates.X509Certificate2 The signer's certificate.
return System

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

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