C# Class MimeKit.Cryptography.X509CertificateStore

A store for X.509 certificates and keys.
A store for X.509 certificates and keys.
Inheritance: IX509Store
Exibir arquivo Open project: nachocove/MimeKit Class Usage Examples

Public Methods

Method Description
Add ( X509Certificate certificate ) : void

Adds the specified certificate to the store.

Adds the specified certificate to the store.

AddRange ( IEnumerable certificates ) : void

Adds the specified range of certificates to the store.

Adds the specified range of certificates to the store.

Export ( Stream stream ) : void

Exports the certificates to an unencrypted stream.

Exports the certificates to an unencrypted stream.

Export ( Stream stream, string password ) : void

Exports the specified stream and password to a pkcs12 encrypted file.

Exports the specified stream and password to a pkcs12 encrypted file.

Export ( string fileName ) : void

Exports the certificates to an unencrypted file.

Exports the certificates to an unencrypted file.

Export ( string fileName, string password ) : void

Exports the specified stream and password to a pkcs12 encrypted file.

Exports the specified stream and password to a pkcs12 encrypted file.

GetMatches ( IX509Selector selector ) : IEnumerable

Gets an enumerator of matching X.509 certificates based on the specified selector.

Gets an enumerator of matching X.509 certificates based on the specified selector.

GetPrivateKey ( X509Certificate certificate ) : AsymmetricKeyParameter

Gets the private key for the specified certificate.

Gets the private key for the specified certificate, if it exists.

Import ( Stream stream ) : void

Imports the certificate(s) from the specified stream.

Imports the certificate(s) from the specified stream.

Import ( Stream stream, string password ) : void

Imports certificates and private keys from the specified stream.

Imports certificates and private keys from the specified pkcs12 stream.

Import ( byte rawData ) : void

Imports the certificate(s) from the specified byte array.

Imports the certificate(s) from the specified byte array.

Import ( byte rawData, string password ) : void

Imports certificates and private keys from the specified byte array.

Imports certificates and private keys from the specified pkcs12 stream.

Import ( string fileName ) : void

Imports the certificate(s) from the specified file.

Imports the certificate(s) from the specified file.

Import ( string fileName, string password ) : void

Imports certificates and private keys from the specified file.

Imports certificates and private keys from the specified pkcs12 stream.

Remove ( X509Certificate certificate ) : void

Removes the specified certificate from the store.

Removes the specified certificate from the store.

RemoveRange ( IEnumerable certificates ) : void

Removes the specified range of certificates from the store.

Removes the specified range of certificates from the store.

X509CertificateStore ( ) : System

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

Creates a new X509CertificateStore.

Private Methods

Method Description
IX509Store ( IX509Selector selector ) : ICollection

Gets a collection of matching X.509 certificates based on the specified selector.

Gets a collection of matching X.509 certificates based on the specified selector.

Method Details

Add() public method

Adds the specified certificate to the store.
Adds the specified certificate to the store.
/// is null. ///
public Add ( X509Certificate certificate ) : void
certificate Org.BouncyCastle.X509.X509Certificate The certificate.
return void

AddRange() public method

Adds the specified range of certificates to the store.
Adds the specified range of certificates to the store.
/// is null. ///
public AddRange ( IEnumerable certificates ) : void
certificates IEnumerable The certificates.
return void

Export() public method

Exports the certificates to an unencrypted stream.
Exports the certificates to an unencrypted stream.
/// is null. /// /// An error occurred while writing to the stream. ///
public Export ( Stream stream ) : void
stream Stream The output stream.
return void

Export() public method

Exports the specified stream and password to a pkcs12 encrypted file.
Exports the specified stream and password to a pkcs12 encrypted file.
/// is null. /// -or- /// is null. /// /// An error occurred while writing to the stream. ///
public Export ( Stream stream, string password ) : void
stream Stream The output stream.
password string The password to use to lock the private keys.
return void

Export() public method

Exports the certificates to an unencrypted file.
Exports the certificates to an unencrypted file.
/// is null. /// /// is a zero-length string, contains only white space, or /// contains one or more invalid characters as defined by /// . /// /// The specified path exceeds the maximum allowed path length of the system. /// /// A directory in the specified path does not exist. /// /// The user does not have access to create the specified file. /// /// An error occurred while writing to the stream. ///
public Export ( string fileName ) : void
fileName string The file path to write to.
return void

Export() public method

Exports the specified stream and password to a pkcs12 encrypted file.
Exports the specified stream and password to a pkcs12 encrypted file.
/// is null. /// -or- /// is null. /// /// is a zero-length string, contains only white space, or /// contains one or more invalid characters as defined by /// . /// /// The specified path exceeds the maximum allowed path length of the system. /// /// A directory in the specified path does not exist. /// /// The user does not have access to create the specified file. /// /// An error occurred while writing to the stream. ///
public Export ( string fileName, string password ) : void
fileName string The file path to write to.
password string The password to use to lock the private keys.
return void

GetMatches() public method

Gets an enumerator of matching X.509 certificates based on the specified selector.
Gets an enumerator of matching X.509 certificates based on the specified selector.
public GetMatches ( IX509Selector selector ) : IEnumerable
selector IX509Selector The match criteria.
return IEnumerable

GetPrivateKey() public method

Gets the private key for the specified certificate.
Gets the private key for the specified certificate, if it exists.
public GetPrivateKey ( X509Certificate certificate ) : AsymmetricKeyParameter
certificate Org.BouncyCastle.X509.X509Certificate The certificate.
return Org.BouncyCastle.Crypto.AsymmetricKeyParameter

Import() public method

Imports the certificate(s) from the specified stream.
Imports the certificate(s) from the specified stream.
/// is null. /// /// An error occurred reading the stream. ///
public Import ( Stream stream ) : void
stream Stream The stream to import.
return void

Import() public method

Imports certificates and private keys from the specified stream.

Imports certificates and private keys from the specified pkcs12 stream.

/// is null. /// -or- /// is null. /// /// An error occurred reading the stream. ///
public Import ( Stream stream, string password ) : void
stream Stream The stream to import.
password string The password to unlock the stream.
return void

Import() public method

Imports the certificate(s) from the specified byte array.
Imports the certificate(s) from the specified byte array.
/// is null. ///
public Import ( byte rawData ) : void
rawData byte The raw certificate data.
return void

Import() public method

Imports certificates and private keys from the specified byte array.

Imports certificates and private keys from the specified pkcs12 stream.

/// is null. /// -or- /// is null. ///
public Import ( byte rawData, string password ) : void
rawData byte The raw certificate data.
password string The password to unlock the raw data.
return void

Import() public method

Imports the certificate(s) from the specified file.
Imports the certificate(s) from the specified file.
/// is null. /// /// The specified file could not be found. /// /// An error occurred reading the file. ///
public Import ( string fileName ) : void
fileName string The name of the file to import.
return void

Import() public method

Imports certificates and private keys from the specified file.

Imports certificates and private keys from the specified pkcs12 stream.

/// is null. /// -or- /// is null. /// /// is a zero-length string, contains only white space, or /// contains one or more invalid characters as defined by /// . /// /// The specified file could not be found. /// /// The user does not have access to read the specified file. /// /// An error occurred reading the file. ///
public Import ( string fileName, string password ) : void
fileName string The name of the file to import.
password string The password to unlock the file.
return void

Remove() public method

Removes the specified certificate from the store.
Removes the specified certificate from the store.
/// is null. ///
public Remove ( X509Certificate certificate ) : void
certificate Org.BouncyCastle.X509.X509Certificate The certificate.
return void

RemoveRange() public method

Removes the specified range of certificates from the store.
Removes the specified range of certificates from the store.
/// is null. ///
public RemoveRange ( IEnumerable certificates ) : void
certificates IEnumerable The certificates.
return void

X509CertificateStore() public method

Initializes a new instance of the MimeKit.Cryptography.X509CertificateStore class.
Creates a new X509CertificateStore.
public X509CertificateStore ( ) : System
return System