C# Класс MimeKit.Cryptography.WindowsSecureMimeContext

An S/MIME cryptography context that uses Windows' System.Security.Cryptography.X509Certificates.X509Store.
An S/MIME cryptography context that uses Windows' System.Security.Cryptography.X509Certificates.X509Store.
Наследование: MimeKit.Cryptography.SecureMimeContext
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Decrypt ( Stream encryptedData ) : MimeEntity

Decrypt the encrypted data.

Decrypt the encrypted data.

EncapsulatedSign ( MailboxAddress signer, DigestAlgorithm digestAlgo, Stream content ) : ApplicationPkcs7Mime

Sign and encapsulate the content using the specified signer.

Sign and encapsulate the content using the specified signer.

Import ( Org certificate ) : void

Import the specified certificate.

Import the specified certificate.

Import ( Stream stream, string password ) : void

Imports certificates and keys from a pkcs12-encoded stream.

Imports certificates and keys from a pkcs12-encoded stream.

Import ( X509Crl crl ) : void

Import the specified certificate revocation list.

Import the specified certificate revocation list.

Sign ( MailboxAddress signer, DigestAlgorithm digestAlgo, Stream content ) : MimePart

Sign the content using the specified signer.

Sign the content using the specified signer.

WindowsSecureMimeContext ( ) : System

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

Constructs an S/MIME context using the current user's X.509 store location.

WindowsSecureMimeContext ( StoreLocation location ) : System

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

Creates a new WindowsSecureMimeContext.

Защищенные методы

Метод Описание
GetCertificate ( IX509Selector selector ) : X509Certificate

Gets the X.509 certificate based on the selector.

Gets the X.509 certificate based on the selector.

GetCertificateRevocationLists ( ) : IX509Store

Gets the certificate revocation lists.

Gets the certificate revocation lists.

GetCmsRecipient ( MailboxAddress mailbox ) : CmsRecipient

Gets the X.509 certificate associated with the MimeKit.MailboxAddress.

Gets the X.509 certificate associated with the MimeKit.MailboxAddress.

GetCmsSigner ( MailboxAddress mailbox, DigestAlgorithm digestAlgo ) : CmsSigner

Gets the cms signer for the specified MimeKit.MailboxAddress.

Gets the cms signer for the specified MimeKit.MailboxAddress.

GetIntermediateCertificates ( ) : IX509Store

Gets the intermediate certificates.

Gets the intermediate certificates.

GetPrivateKey ( IX509Selector selector ) : AsymmetricKeyParameter

Gets the private key based on the provided selector.

Gets the private key based on the provided selector.

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

Gets the trusted anchors.

Gets the trusted anchors.

UpdateSecureMimeCapabilities ( Org 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[]
GetCmsRecipientCertificate ( MailboxAddress mailbox ) : X509Certificate2
GetCmsSignerCertificate ( MailboxAddress mailbox ) : X509Certificate2
GetRealCmsRecipient ( MailboxAddress mailbox ) : CmsRecipient
GetRealCmsRecipients ( IEnumerable mailboxes ) : CmsRecipientCollection
GetRealCmsSigner ( MailboxAddress mailbox, DigestAlgorithm digestAlgo ) : System.Security.Cryptography.Pkcs.CmsSigner
ReadAllBytes ( Stream stream ) : byte[]

Описание методов

Decrypt() публичный Метод

Decrypt the encrypted data.
Decrypt the encrypted data.
/// is null. /// /// An error occurred in the cryptographic message syntax subsystem. ///
public Decrypt ( Stream encryptedData ) : MimeEntity
encryptedData Stream The encrypted data.
Результат MimeEntity

EncapsulatedSign() публичный Метод

Sign and encapsulate the content using the specified signer.
Sign and encapsulate the content using the specified signer.
/// is null. /// -or- /// is null. /// /// is out of range. /// /// The specified is not supported by this context. /// /// A signing certificate could not be found for . /// /// An error occurred in the cryptographic message syntax subsystem. ///
public EncapsulatedSign ( MailboxAddress signer, DigestAlgorithm digestAlgo, Stream content ) : ApplicationPkcs7Mime
signer MailboxAddress The signer.
digestAlgo DigestAlgorithm The digest algorithm to use for signing.
content Stream The content.
Результат ApplicationPkcs7Mime

GetCertificate() защищенный Метод

Gets the X.509 certificate based on the selector.
Gets the X.509 certificate based on the selector.
protected GetCertificate ( IX509Selector selector ) : X509Certificate
selector IX509Selector The search criteria for the certificate.
Результат Org.BouncyCastle.X509.X509Certificate

GetCertificateRevocationLists() защищенный Метод

Gets the certificate revocation lists.
Gets the certificate revocation lists.
protected GetCertificateRevocationLists ( ) : IX509Store
Результат IX509Store

GetCmsRecipient() защищенный Метод

Gets the X.509 certificate associated with the MimeKit.MailboxAddress.
Gets the X.509 certificate associated with the MimeKit.MailboxAddress.
/// A certificate for the specified could not be found. ///
protected GetCmsRecipient ( MailboxAddress mailbox ) : CmsRecipient
mailbox MailboxAddress The mailbox.
Результат CmsRecipient

GetCmsSigner() защищенный Метод

Gets the cms signer for the specified MimeKit.MailboxAddress.
Gets the cms signer for the specified MimeKit.MailboxAddress.
/// 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.
Gets the intermediate certificates.
protected GetIntermediateCertificates ( ) : IX509Store
Результат IX509Store

GetPrivateKey() защищенный Метод

Gets the private key based on the provided selector.
Gets the private key based on the provided selector.
protected GetPrivateKey ( IX509Selector selector ) : AsymmetricKeyParameter
selector IX509Selector The search criteria for the private key.
Результат Org.BouncyCastle.Crypto.AsymmetricKeyParameter

GetTrustedAnchors() защищенный Метод

Gets the trusted anchors.
Gets the trusted anchors.
protected GetTrustedAnchors ( ) : Org.BouncyCastle.Utilities.Collections.HashSet
Результат Org.BouncyCastle.Utilities.Collections.HashSet

Import() публичный Метод

Import the specified certificate.
Import the specified certificate.
/// is null. ///
public Import ( Org certificate ) : void
certificate Org The certificate.
Результат void

Import() публичный Метод

Imports certificates and keys from a pkcs12-encoded stream.
Imports certificates and keys from a pkcs12-encoded stream.
/// is null. /// -or- /// is null. /// /// Importing keys is not supported by this cryptography context. ///
public Import ( Stream stream, string password ) : void
stream Stream The raw certificate and key data.
password string The password to unlock the stream.
Результат void

Import() публичный Метод

Import the specified certificate revocation list.
Import the specified certificate revocation list.
/// is null. ///
public Import ( X509Crl crl ) : void
crl Org.BouncyCastle.X509.X509Crl The certificate revocation list.
Результат void

Sign() публичный Метод

Sign the content using the specified signer.
Sign the content using the specified signer.
/// is null. /// -or- /// is null. /// /// is out of range. /// /// The specified is not supported by this context. /// /// A signing certificate could not be found for . /// /// An error occurred in the cryptographic message syntax subsystem. ///
public Sign ( MailboxAddress signer, DigestAlgorithm digestAlgo, Stream content ) : MimePart
signer MailboxAddress The signer.
digestAlgo DigestAlgorithm The digest algorithm to use for signing.
content Stream The content.
Результат MimePart

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 ( Org certificate, EncryptionAlgorithm algorithms, System.DateTime timestamp ) : void
certificate Org The certificate.
algorithms EncryptionAlgorithm The encryption algorithm capabilities of the client (in preferred order).
timestamp System.DateTime The timestamp.
Результат void

WindowsSecureMimeContext() публичный Метод

Initializes a new instance of the MimeKit.Cryptography.WindowsSecureMimeContext class.
Constructs an S/MIME context using the current user's X.509 store location.
public WindowsSecureMimeContext ( ) : System
Результат System

WindowsSecureMimeContext() публичный Метод

Initializes a new instance of the MimeKit.Cryptography.WindowsSecureMimeContext class.
Creates a new WindowsSecureMimeContext.
public WindowsSecureMimeContext ( StoreLocation location ) : System
location StoreLocation The X.509 store location.
Результат System