Windows Secure Mime Context Class
A Secure MIME (S/MIME) cryptography context.
Definition
Namespace: MimeKit.Cryptography
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
Assembly: MimeKit.Cryptography (in MimeKit.Cryptography.dll) Version: 5.0.0
C#
public class WindowsSecureMimeContext : SecureMimeContext- Inheritance
- Object CryptographyContext SecureMimeContext WindowsSecureMimeContext
Remarks
An S/MIME cryptography context that uses X509Store
for certificate storage and retrieval.
Constructors
| WindowsSecureMimeContext | Initialize a new instance of the WindowsSecureMimeContext class. |
| WindowsSecureMimeContext(StoreLocation) | Initialize a new instance of the WindowsSecureMimeContext class. |
Properties
| EnabledEncryptionAlgorithms |
Get the enabled encryption algorithms in ranked order.
(Inherited from CryptographyContext) |
| EncryptionAlgorithmRank |
Get the preferred rank order for the encryption algorithms; from the most preferred to the least.
(Inherited from CryptographyContext) |
| EncryptionProtocol |
Get the encryption protocol.
(Inherited from SecureMimeContext) |
| KeyExchangeProtocol |
Get the key exchange protocol.
(Inherited from SecureMimeContext) |
| MaxDecompressedSize |
Get or set the maximum decompressed CMS content size in bytes.
(Inherited from SecureMimeContext) |
| PrepareBeforeSigning |
Get or set whether a MimeEntity should be prepared before signing.
(Inherited from CryptographyContext) |
| SignatureProtocol |
Get the signature protocol.
(Inherited from SecureMimeContext) |
| StoreLocation | Gets the X.509 store location. |
Methods
| CanEncrypt |
Check whether the cryptography context can encrypt to a particular recipient.
(Overrides CryptographyContextCanEncrypt(MailboxAddress, CancellationToken)) |
| CanEncryptAsync |
Asynchronously check whether the cryptography context can encrypt to a particular recipient.
(Inherited from CryptographyContext) |
| CanSign |
Check whether a particular mailbox address can be used for signing.
(Overrides CryptographyContextCanSign(MailboxAddress, CancellationToken)) |
| CanSignAsync |
Asynchronously check whether a particular mailbox address can be used for signing.
(Inherited from CryptographyContext) |
| Compress |
Compress the specified stream.
(Inherited from SecureMimeContext) |
| CompressAsync |
Asynchronously compress the specified stream.
(Inherited from SecureMimeContext) |
| Decompress |
Decompress the specified stream.
(Inherited from SecureMimeContext) |
| DecompressAsync |
Asynchronously decompress the specified stream.
(Inherited from SecureMimeContext) |
| DecompressTo |
Decompress the specified stream to an output stream.
(Inherited from SecureMimeContext) |
| DecompressToAsync |
Asynchronously decompress the specified stream to an output stream.
(Inherited from SecureMimeContext) |
| Decrypt |
Decrypt the encrypted data.
(Overrides CryptographyContextDecrypt(Stream, CancellationToken)) |
| DecryptAsync |
Asynchronously decrypt the encrypted data.
(Overrides CryptographyContextDecryptAsync(Stream, CancellationToken)) |
| DecryptTo |
Decrypt the specified encryptedData to an output stream.
(Overrides SecureMimeContextDecryptTo(Stream, Stream, CancellationToken)) |
| DecryptToAsync |
Asynchronously decrypt the specified encryptedData to an output stream.
(Overrides SecureMimeContextDecryptToAsync(Stream, Stream, CancellationToken)) |
| Disable |
Disable the encryption algorithm.
(Inherited from CryptographyContext) |
| Dispose |
Releases all resources used by the CryptographyContext object.
(Inherited from CryptographyContext) |
| Dispose(Boolean) |
Releases the unmanaged resources used by the CryptographyContext and
optionally releases the managed resources.
(Inherited from CryptographyContext) |
| Enable |
Enable the encryption algorithm.
(Inherited from CryptographyContext) |
| EncapsulatedSign(CmsSigner, Stream, CancellationToken) |
Sign and encapsulate the content using the specified signer.
(Overrides SecureMimeContextEncapsulatedSign(CmsSigner, Stream, CancellationToken)) |
| EncapsulatedSign(MailboxAddress, DigestAlgorithm, Stream, CancellationToken) |
Sign and encapsulate the content using the specified signer.
(Overrides SecureMimeContextEncapsulatedSign(MailboxAddress, DigestAlgorithm, Stream, CancellationToken)) |
| EncapsulatedSignAsync(CmsSigner, Stream, CancellationToken) |
Asynchronously sign and encapsulate the content using the specified signer.
(Overrides SecureMimeContextEncapsulatedSignAsync(CmsSigner, Stream, CancellationToken)) |
| EncapsulatedSignAsync(MailboxAddress, DigestAlgorithm, Stream, CancellationToken) |
Asynchronously sign and encapsulate the content using the specified signer.
(Overrides SecureMimeContextEncapsulatedSignAsync(MailboxAddress, DigestAlgorithm, Stream, CancellationToken)) |
| Encrypt(CmsRecipientCollection, Stream, CancellationToken) |
Encrypt the specified content for the specified recipients.
(Overrides SecureMimeContextEncrypt(CmsRecipientCollection, Stream, CancellationToken)) |
| Encrypt(IEnumerableMailboxAddress, Stream, CancellationToken) |
Encrypt the specified content for the specified recipients.
(Overrides CryptographyContextEncrypt(IEnumerableMailboxAddress, Stream, CancellationToken)) |
| EncryptAsync(CmsRecipientCollection, Stream, CancellationToken) |
Asynchronously encrypt the specified content for the specified recipients.
(Overrides SecureMimeContextEncryptAsync(CmsRecipientCollection, Stream, CancellationToken)) |
| EncryptAsync(IEnumerableMailboxAddress, Stream, CancellationToken) |
Asynchronously encrypt the specified content for the specified recipients.
(Overrides CryptographyContextEncryptAsync(IEnumerableMailboxAddress, Stream, CancellationToken)) |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
| Export |
Export certificates for the specified mailboxes.
(Overrides CryptographyContextExport(IEnumerableMailboxAddress, CancellationToken)) |
| ExportAsync |
Asynchronously export certificates for the specified mailboxes.
(Overrides CryptographyContextExportAsync(IEnumerableMailboxAddress, CancellationToken)) |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
| GetCmsRecipient | Get the CmsRecipient for the specified mailbox. |
| GetCmsSigner | Get the CmsSigner for the specified mailbox. |
| GetDigestAlgorithm |
Get the digest algorithm from the micalg parameter value in a multipart/signed part.
(Inherited from SecureMimeContext) |
| GetDigestAlgorithmName |
Get the string name of the digest algorithm for use with the micalg parameter of a multipart/signed part.
(Inherited from SecureMimeContext) |
| GetHashCode | Serves as the default hash function. (Inherited from Object) |
| GetPreferredEncryptionAlgorithm(CmsRecipientCollection) |
Get the preferred encryption algorithm to use for encrypting to the specified recipients.
(Inherited from SecureMimeContext) |
| GetPreferredEncryptionAlgorithm(CmsRecipientCollection) | Get the preferred encryption algorithm to use for encrypting to the specified recipients. |
| GetRecipientCertificate | Get the certificate for the specified recipient. |
| GetSignerCertificate | Get the certificate for the specified signer. |
| GetType | Gets the Type of the current instance. (Inherited from Object) |
| Import(Stream, CancellationToken) |
Import certificates (as from a certs-only application/pkcs-mime part)
from the specified stream.
(Inherited from SecureMimeContext) |
| Import(X509Certificate, CancellationToken) |
Import a certificate.
(Overrides SecureMimeContextImport(X509Certificate, CancellationToken)) |
| Import(X509Certificate2, CancellationToken) |
Import a certificate.
(Overrides SecureMimeContextImport(X509Certificate2, CancellationToken)) |
| Import(X509Crl, CancellationToken) |
Import a certificate revocation list.
(Overrides SecureMimeContextImport(X509Crl, CancellationToken)) |
| Import(StoreName, X509Certificate, CancellationToken) | Import the specified certificate. |
| Import(StoreName, X509Certificate2, CancellationToken) | Import the specified certificate. |
| Import(Stream, String, CancellationToken) |
Import certificates and keys from a pkcs12-encoded stream.
(Overrides SecureMimeContextImport(Stream, String, CancellationToken)) |
| Import(String, String, CancellationToken) |
Import certificates and keys from a pkcs12 file.
(Inherited from SecureMimeContext) |
| Import(Stream, String, X509KeyStorageFlags, CancellationToken) | Import certificates and keys from a pkcs12-encoded stream. |
| ImportAsync(Stream, CancellationToken) |
Asynchronously import certificates (as from a certs-only application/pkcs-mime part)
from the specified stream.
(Inherited from SecureMimeContext) |
| ImportAsync(X509Certificate, CancellationToken) |
Asynchronously import a certificate.
(Inherited from SecureMimeContext) |
| ImportAsync(X509Certificate2, CancellationToken) |
Asynchronously import a certificate.
(Inherited from SecureMimeContext) |
| ImportAsync(X509Crl, CancellationToken) |
Asynchronously import a certificate revocation list.
(Inherited from SecureMimeContext) |
| ImportAsync(Stream, String, CancellationToken) |
Asynchronously import certificates and keys from a pkcs12-encoded stream.
(Overrides SecureMimeContextImportAsync(Stream, String, CancellationToken)) |
| ImportAsync(String, String, CancellationToken) |
Asynchronously import certificates and keys from a pkcs12 file.
(Inherited from SecureMimeContext) |
| ImportAsync(Stream, String, X509KeyStorageFlags, CancellationToken) | Asynchronously import certificates and keys from a pkcs12-encoded stream. |
| IsEnabled |
Check whether the specified encryption algorithm is enabled.
(Inherited from CryptographyContext) |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) |
| Sign(CmsSigner, Stream, CancellationToken) |
Sign the content using the specified signer.
(Overrides SecureMimeContextSign(CmsSigner, Stream, CancellationToken)) |
| Sign(MailboxAddress, DigestAlgorithm, Stream, CancellationToken) |
Sign the content using the specified signer.
(Overrides CryptographyContextSign(MailboxAddress, DigestAlgorithm, Stream, CancellationToken)) |
| SignAsync(CmsSigner, Stream, CancellationToken) |
Asynchronously sign the content using the specified signer.
(Overrides SecureMimeContextSignAsync(CmsSigner, Stream, CancellationToken)) |
| SignAsync(MailboxAddress, DigestAlgorithm, Stream, CancellationToken) |
Asynchronously sign the content using the specified signer.
(Overrides CryptographyContextSignAsync(MailboxAddress, DigestAlgorithm, Stream, CancellationToken)) |
| Supports |
Check whether the specified protocol is supported by the CryptographyContext.
(Inherited from SecureMimeContext) |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
| TryGetDigestAlgorithm | Attempt to map a Oid to a DigestAlgorithm. |
| UpdateSecureMimeCapabilities | Updates the known S/MIME capabilities of the client used by the recipient that owns the specified certificate. |
| Verify(Stream, DigitalSignatureCollection, CancellationToken) |
Verify the digital signatures of the specified signed data and extract the original content.
(Overrides SecureMimeContextVerify(Stream, DigitalSignatureCollection, CancellationToken)) |
| Verify(Stream, MimeEntity, CancellationToken) |
Verify the digital signatures of the specified signed data and extract the original content.
(Overrides SecureMimeContextVerify(Stream, MimeEntity, CancellationToken)) |
| Verify(Stream, Stream, CancellationToken) |
Verify the specified content using the detached signature data.
(Overrides CryptographyContextVerify(Stream, Stream, CancellationToken)) |
| VerifyAsync |
Asynchronously verify the specified content using the detached signature data.
(Overrides CryptographyContextVerifyAsync(Stream, Stream, CancellationToken)) |