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 abstract class SecureMimeContext : CryptographyContext,
ISecureMimeContext, ICryptographyContext, IDisposable- Inheritance
- Object CryptographyContext SecureMimeContext
- Derived
- Implements
- ICryptographyContext, ISecureMimeContext, IDisposable
Remarks
Generally speaking, applications should not use a SecureMimeContext
directly, but rather via higher level APIs such as MultipartSigned
and ApplicationPkcs7Mime.
Constructors
| SecureMimeContext | Initialize a new instance of the SecureMimeContext 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.
(Overrides CryptographyContextEncryptionProtocol) |
| KeyExchangeProtocol |
Get the key exchange protocol.
(Overrides CryptographyContextKeyExchangeProtocol) |
| MaxDecompressedSize | Get or set the maximum decompressed CMS content size in bytes. |
| PrepareBeforeSigning |
Get or set whether a MimeEntity should be prepared before signing.
(Inherited from CryptographyContext) |
| SignatureProtocol |
Get the signature protocol.
(Overrides CryptographyContextSignatureProtocol) |
Methods
| CanEncrypt |
Check whether the cryptography context can encrypt to a particular recipient.
(Inherited from CryptographyContext) |
| 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.
(Inherited from CryptographyContext) |
| CanSignAsync |
Asynchronously check whether a particular mailbox address can be used for signing.
(Inherited from CryptographyContext) |
| Compress | Compress the specified stream. |
| CompressAsync | Asynchronously compress the specified stream. |
| Decompress | Decompress the specified stream. |
| DecompressAsync | Asynchronously decompress the specified stream. |
| DecompressTo | Decompress the specified stream to an output stream. |
| DecompressToAsync | Asynchronously decompress the specified stream to an output stream. |
| Decrypt |
Decrypt the specified encryptedData.
(Inherited from CryptographyContext) |
| DecryptAsync |
Asynchronously decrypt the specified encryptedData.
(Inherited from CryptographyContext) |
| DecryptTo | Decrypt the specified encryptedData to an output stream. |
| DecryptToAsync | Asynchronously decrypt the specified encryptedData to an output stream. |
| 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. |
| EncapsulatedSign(MailboxAddress, DigestAlgorithm, Stream, CancellationToken) | Sign and encapsulate the content using the specified signer and digest algorithm. |
| EncapsulatedSignAsync(CmsSigner, Stream, CancellationToken) | Asynchronously sign and encapsulate the content using the specified signer. |
| EncapsulatedSignAsync(MailboxAddress, DigestAlgorithm, Stream, CancellationToken) | Asynchronously sign and encapsulate the content using the specified signer and digest algorithm. |
| Encrypt(CmsRecipientCollection, Stream, CancellationToken) | Encrypt the specified content for the specified recipients. |
| Encrypt(IEnumerableMailboxAddress, Stream, CancellationToken) |
Encrypt the specified content for the specified recipients.
(Inherited from CryptographyContext) |
| EncryptAsync(CmsRecipientCollection, Stream, CancellationToken) | Asynchronously encrypt the specified content for the specified recipients. |
| EncryptAsync(IEnumerableMailboxAddress, Stream, CancellationToken) |
Asynchronously encrypt the specified content for the specified recipients.
(Inherited from CryptographyContext) |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
| Export |
Exports the keys for the specified mailboxes.
(Inherited from CryptographyContext) |
| ExportAsync |
Asynchronously exports the keys for the specified mailboxes.
(Inherited from CryptographyContext) |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
| GetDigestAlgorithm |
Get the digest algorithm from the micalg parameter value in a multipart/signed part.
(Overrides CryptographyContextGetDigestAlgorithm(String)) |
| GetDigestAlgorithmName |
Get the string name of the digest algorithm for use with the micalg parameter of a multipart/signed part.
(Overrides CryptographyContextGetDigestAlgorithmName(DigestAlgorithm)) |
| GetDigestOid | Get the OID for the digest algorithm. |
| GetHashCode | Serves as the default hash function. (Inherited from Object) |
| GetPreferredEncryptionAlgorithm | Get the preferred encryption algorithm to use for encrypting to the specified recipients. |
| 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.
(Overrides CryptographyContextImport(Stream, CancellationToken)) |
| Import(X509Certificate, CancellationToken) | Import a certificate. |
| Import(X509Certificate2, CancellationToken) | Import a certificate. |
| Import(X509Crl, CancellationToken) | Import a certificate revocation list. |
| Import(Stream, String, CancellationToken) | Import certificates and keys from a pkcs12-encoded stream. |
| Import(String, String, CancellationToken) | Import certificates and keys from a pkcs12 file. |
| ImportAsync(Stream, CancellationToken) |
Asynchronously import certificates (as from a certs-only application/pkcs-mime part)
from the specified stream.
(Overrides CryptographyContextImportAsync(Stream, CancellationToken)) |
| ImportAsync(X509Certificate, CancellationToken) | Asynchronously import a certificate. |
| ImportAsync(X509Certificate2, CancellationToken) | Asynchronously import a certificate. |
| ImportAsync(X509Crl, CancellationToken) | Asynchronously import a certificate revocation list. |
| ImportAsync(Stream, String, CancellationToken) | Asynchronously import certificates and keys from a pkcs12-encoded stream. |
| ImportAsync(String, String, CancellationToken) | Asynchronously import certificates and keys from a pkcs12 file. |
| 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. |
| Sign(MailboxAddress, DigestAlgorithm, Stream, CancellationToken) |
Sign the content using the specified signer and digest algorithm.
(Inherited from CryptographyContext) |
| SignAsync(CmsSigner, Stream, CancellationToken) | Asynchronously sign the content using the specified signer. |
| SignAsync(MailboxAddress, DigestAlgorithm, Stream, CancellationToken) |
Asynchronously sign the content using the specified signer and digest algorithm.
(Inherited from CryptographyContext) |
| Supports |
Check whether the specified protocol is supported by the CryptographyContext.
(Overrides CryptographyContextSupports(String)) |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
| Verify(Stream, Stream, CancellationToken) |
Verify the specified content using the detached signatureData.
(Inherited from CryptographyContext) |
| Verify(Stream, DigitalSignatureCollection, CancellationToken) | Verify the digital signatures of the specified signed data and extract the original content. |
| Verify(Stream, MimeEntity, CancellationToken) | Verify the digital signatures of the specified signed data and extract the original content. |
| VerifyAsync |
Asynchronously verify the specified content using the detached signatureData.
(Inherited from CryptographyContext) |