C# 클래스 MimeKit.Cryptography.DefaultSecureMimeContext

A default SecureMimeContext implementation that uses an SQLite database as a certificate and private key store.
The default S/MIME context is designed to be usable on any platform where there exists a .NET runtime by storing certificates, CRLs, and (encrypted) private keys in a SQLite database.
상속: MimeKit.Cryptography.SecureMimeContext
파일 보기 프로젝트 열기: nachocove/MimeKit

공개 프로퍼티들

프로퍼티 타입 설명
DefaultDatabasePath string

공개 메소드들

메소드 설명
DefaultSecureMimeContext ( IX509CertificateDatabase database ) : System

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

This constructor is useful for supplying a custom IX509CertificateDatabase.

DefaultSecureMimeContext ( string password ) : System

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

Allows the program to specify its own password for the default database.

Requires linking with Mono.Data.Sqlite.

DefaultSecureMimeContext ( string fileName, string password ) : System

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

Allows the program to specify its own location for the SQLite database. If the file does not exist, it will be created and the necessary tables and indexes will be constructed.

Requires linking with Mono.Data.Sqlite.

Import ( Stream stream, bool trusted ) : void

Imports a DER-encoded certificate stream.

Imports all of the certificates in the DER-encoded stream.

Import ( Stream stream, string password ) : void

Imports certificates and keys from a pkcs12-encoded stream.

Imports all of the certificates and keys from the pkcs12-encoded stream.

Import ( X509Certificate certificate ) : void

Imports a certificate.

Imports the specified certificate into the database.

Import ( X509Crl crl ) : void

Imports a certificate revocation list.

Imports the specified certificate revocation list.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the DefaultSecureMimeContext and optionally releases the managed resources.

Releases the unmanaged resources used by the DefaultSecureMimeContext and optionally releases the managed resources.

GetCertificate ( IX509Selector selector ) : X509Certificate

Gets the X.509 certificate matching the specified selector.

Gets the first certificate that matches the specified selector.

GetCertificateRevocationLists ( ) : IX509Store

Gets the certificate revocation lists.

A Certificate Revocation List (CRL) is a list of certificate serial numbers issued by a particular Certificate Authority (CA) that have been revoked, either by the CA itself or by the owner of the revoked certificate.

GetCmsRecipient ( MailboxAddress mailbox ) : CmsRecipient

Gets the CmsRecipient for the specified mailbox.

Constructs a CmsRecipient with the appropriate certificate and CmsRecipient.EncryptionAlgorithms for the specified mailbox.

If the mailbox is a SecureMailboxAddress, the SecureMailboxAddress.Fingerprint property will be used instead of the mailbox address for database lookups.

GetCmsSigner ( MailboxAddress mailbox, DigestAlgorithm digestAlgo ) : CmsSigner

Gets the CmsSigner for the specified mailbox.

Constructs a CmsSigner with the appropriate signing certificate for the specified mailbox.

If the mailbox is a SecureMailboxAddress, the SecureMailboxAddress.Fingerprint property will be used instead of the mailbox address for database lookups.

GetIntermediateCertificates ( ) : IX509Store

Gets the intermediate certificates.

An intermediate certificate is any certificate that exists between the root certificate issued by a Certificate Authority (CA) and the certificate at the end of the chain.

GetPrivateKey ( IX509Selector selector ) : AsymmetricKeyParameter

Gets the private key for the certificate matching the specified selector.

Gets the private key for the first certificate that matches the specified selector.

GetTrustedAnchors ( ) : Org.BouncyCastle.Utilities.Collections.HashSet

Gets the trusted anchors.

A trusted anchor is a trusted root-level X.509 certificate, generally issued by a Certificate Authority (CA).

UpdateSecureMimeCapabilities ( X509Certificate certificate, EncryptionAlgorithm algorithms, System.DateTime timestamp ) : void

Updates the known S/MIME capabilities of the client used by the recipient that owns the specified certificate.

Updates the known S/MIME capabilities of the client used by the recipient that owns the specified certificate.

비공개 메소드들

메소드 설명
DecodeEncryptionAlgorithms ( byte rawData ) : EncryptionAlgorithm[]
DefaultSecureMimeContext ( ) : System

메소드 상세

DefaultSecureMimeContext() 공개 메소드

Initializes a new instance of the MimeKit.Cryptography.DefaultSecureMimeContext class.
This constructor is useful for supplying a custom IX509CertificateDatabase.
/// is null. ///
public DefaultSecureMimeContext ( IX509CertificateDatabase database ) : System
database IX509CertificateDatabase The certificate database.
리턴 System

DefaultSecureMimeContext() 공개 메소드

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

Allows the program to specify its own password for the default database.

Requires linking with Mono.Data.Sqlite.

/// Mono.Data.Sqlite is not available. /// /// The user does not have access to read the database at the default location. /// /// An error occurred reading the database at the default location. ///
public DefaultSecureMimeContext ( string password ) : System
password string The password used for encrypting and decrypting the private keys.
리턴 System

DefaultSecureMimeContext() 공개 메소드

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

Allows the program to specify its own location for the SQLite database. If the file does not exist, it will be created and the necessary tables and indexes will be constructed.

Requires linking with Mono.Data.Sqlite.

/// is null. /// -or- /// is null. /// /// The specified file path is empty. /// /// Mono.Data.Sqlite is not available. /// /// The user does not have access to read the specified file. /// /// An error occurred reading the file. ///
public DefaultSecureMimeContext ( string fileName, string password ) : System
fileName string The path to the SQLite database.
password string The password used for encrypting and decrypting the private keys.
리턴 System

Dispose() 보호된 메소드

Releases the unmanaged resources used by the DefaultSecureMimeContext and optionally releases the managed resources.
Releases the unmanaged resources used by the DefaultSecureMimeContext and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; /// false to release only the unmanaged resources.
리턴 void

GetCertificate() 보호된 메소드

Gets the X.509 certificate matching the specified selector.
Gets the first certificate that matches the specified selector.
protected GetCertificate ( IX509Selector selector ) : X509Certificate
selector IX509Selector The search criteria for the certificate.
리턴 Org.BouncyCastle.X509.X509Certificate

GetCertificateRevocationLists() 보호된 메소드

Gets the certificate revocation lists.
A Certificate Revocation List (CRL) is a list of certificate serial numbers issued by a particular Certificate Authority (CA) that have been revoked, either by the CA itself or by the owner of the revoked certificate.
protected GetCertificateRevocationLists ( ) : IX509Store
리턴 IX509Store

GetCmsRecipient() 보호된 메소드

Gets the CmsRecipient for the specified mailbox.

Constructs a CmsRecipient with the appropriate certificate and CmsRecipient.EncryptionAlgorithms for the specified mailbox.

If the mailbox is a SecureMailboxAddress, the SecureMailboxAddress.Fingerprint property will be used instead of the mailbox address for database lookups.

/// A certificate for the specified could not be found. ///
protected GetCmsRecipient ( MailboxAddress mailbox ) : CmsRecipient
mailbox MailboxAddress The mailbox.
리턴 CmsRecipient

GetCmsSigner() 보호된 메소드

Gets the CmsSigner for the specified mailbox.

Constructs a CmsSigner with the appropriate signing certificate for the specified mailbox.

If the mailbox is a SecureMailboxAddress, the SecureMailboxAddress.Fingerprint property will be used instead of the mailbox address for database lookups.

/// A certificate for the specified could not be found. ///
protected GetCmsSigner ( MailboxAddress mailbox, DigestAlgorithm digestAlgo ) : CmsSigner
mailbox MailboxAddress The mailbox.
digestAlgo DigestAlgorithm The preferred digest algorithm.
리턴 CmsSigner

GetIntermediateCertificates() 보호된 메소드

Gets the intermediate certificates.
An intermediate certificate is any certificate that exists between the root certificate issued by a Certificate Authority (CA) and the certificate at the end of the chain.
protected GetIntermediateCertificates ( ) : IX509Store
리턴 IX509Store

GetPrivateKey() 보호된 메소드

Gets the private key for the certificate matching the specified selector.
Gets the private key for the first certificate that matches the specified selector.
protected GetPrivateKey ( IX509Selector selector ) : AsymmetricKeyParameter
selector IX509Selector The search criteria for the private key.
리턴 Org.BouncyCastle.Crypto.AsymmetricKeyParameter

GetTrustedAnchors() 보호된 메소드

Gets the trusted anchors.
A trusted anchor is a trusted root-level X.509 certificate, generally issued by a Certificate Authority (CA).
protected GetTrustedAnchors ( ) : Org.BouncyCastle.Utilities.Collections.HashSet
리턴 Org.BouncyCastle.Utilities.Collections.HashSet

Import() 공개 메소드

Imports a DER-encoded certificate stream.
Imports all of the certificates in the DER-encoded stream.
/// is null. ///
public Import ( Stream stream, bool trusted ) : void
stream Stream The raw certificate(s).
trusted bool true if the certificates are trusted.
리턴 void

Import() 공개 메소드

Imports certificates and keys from a pkcs12-encoded stream.
Imports all of the certificates and keys from the pkcs12-encoded stream.
/// is null. /// -or- /// is null. /// /// An error occurred in the cryptographic message syntax subsystem. ///
public Import ( Stream stream, string password ) : void
stream Stream The raw certificate and key data.
password string The password to unlock the data.
리턴 void

Import() 공개 메소드

Imports a certificate.
Imports the specified certificate into the database.
/// is null. ///
public Import ( X509Certificate certificate ) : void
certificate Org.BouncyCastle.X509.X509Certificate The certificate.
리턴 void

Import() 공개 메소드

Imports a certificate revocation list.
Imports the specified certificate revocation list.
/// is null. ///
public Import ( X509Crl crl ) : void
crl Org.BouncyCastle.X509.X509Crl The certificate revocation list.
리턴 void

UpdateSecureMimeCapabilities() 보호된 메소드

Updates the known S/MIME capabilities of the client used by the recipient that owns the specified certificate.
Updates the known S/MIME capabilities of the client used by the recipient that owns the specified certificate.
protected UpdateSecureMimeCapabilities ( X509Certificate certificate, EncryptionAlgorithm algorithms, System.DateTime timestamp ) : void
certificate Org.BouncyCastle.X509.X509Certificate The certificate.
algorithms EncryptionAlgorithm The encryption algorithm capabilities of the client (in preferred order).
timestamp System.DateTime The timestamp in coordinated universal time (UTC).
리턴 void

프로퍼티 상세

DefaultDatabasePath 공개적으로 정적으로 프로퍼티

The default database path for certificates, private keys and CRLs.

On Microsoft Windows-based systems, this path will be something like C:\Users\UserName\AppData\Roaming\mimekit\smime.db.

On Unix systems such as Linux and Mac OS X, this path will be ~/.mimekit/smime.db.

public static string DefaultDatabasePath
리턴 string