Click or drag to resize
MimeKit

CryptographyContext Class

An abstract cryptography context.
Inheritance Hierarchy
SystemObject
  MimeKit.CryptographyCryptographyContext
    MimeKit.CryptographyOpenPgpContext
    MimeKit.CryptographySecureMimeContext

Namespace: MimeKit.Cryptography
Assembly: MimeKit (in MimeKit.dll) Version: 4.7.1
Syntax
C#
public abstract class CryptographyContext : ICryptographyContext, 
	IDisposable

The CryptographyContext type exposes the following members.

Constructors
 NameDescription
Protected methodCryptographyContext Initialize a new instance of the CryptographyContext class.
Top
Properties
 NameDescription
Protected propertyDigestAlgorithmRank Get the preferred rank order for the digest algorithms; from the most preferred to the least.
Public propertyEnabledDigestAlgorithms Get the enabled digest algorithms in ranked order.
Public propertyEnabledEncryptionAlgorithms Get the enabled encryption algorithms in ranked order.
Protected propertyEncryptionAlgorithmRank Get the preferred rank order for the encryption algorithms; from the most preferred to the least.
Public propertyEncryptionProtocol Get the encryption protocol.
Public propertyKeyExchangeProtocol Get the key exchange protocol.
Public propertyPrepareBeforeSigning Get or set whether a MimeEntity should be prepared before signing.
Public propertySignatureProtocol Get the signature protocol.
Top
Methods
 NameDescription
Public methodCanEncrypt Check whether or not the cryptography context can encrypt to a particular recipient.
Public methodCanEncryptAsync Asynchronously check whether or not the cryptography context can encrypt to a particular recipient.
Public methodCanSign Check whether or not a particular mailbox address can be used for signing.
Public methodCanSignAsync Asynchronously check whether or not a particular mailbox address can be used for signing.
Public methodStatic memberCreate Creates a new CryptographyContext for the specified protocol.
Public methodDecrypt Decrypt the specified encryptedData.
Public methodDecryptAsync Asynchronously decrypt the specified encryptedData.
Public methodDisable(DigestAlgorithm) Disable the digest algorithm.
Public methodDisable(EncryptionAlgorithm) Disable the encryption algorithm.
Public methodDispose Releases all resources used by the CryptographyContext object.
Protected methodDispose(Boolean) Releases the unmanaged resources used by the CryptographyContext and optionally releases the managed resources.
Public methodEnable(DigestAlgorithm) Enable the digest algorithm.
Public methodEnable(EncryptionAlgorithm) Enable the encryption algorithm.
Public methodEncrypt Encrypt the specified content for the specified recipients.
Public methodEncryptAsync Asynchronously encrypt the specified content for the specified recipients.
Public methodEquals
(Inherited from Object)
Public methodExport Exports the keys for the specified mailboxes.
Public methodExportAsync Asynchronously exports the keys for the specified mailboxes.
Protected methodFinalize
(Inherited from Object)
Public methodGetDigestAlgorithm Get the digest algorithm from the micalg parameter value in a multipart/signed part.
Public methodGetDigestAlgorithmName Get the string name of the digest algorithm for use with the micalg parameter of a multipart/signed part.
Public methodGetHashCode
(Inherited from Object)
Public methodGetType
(Inherited from Object)
Public methodImport Imports the public certificates or keys from the specified stream.
Public methodImportAsync Asynchronously imports the public certificates or keys from the specified stream.
Public methodIsEnabled(DigestAlgorithm) Check whether the specified digest algorithm is enabled.
Public methodIsEnabled(EncryptionAlgorithm) Check whether the specified encryption algorithm is enabled.
Protected methodMemberwiseClone
(Inherited from Object)
Public methodStatic memberRegister(FuncOpenPgpContext) Registers a default OpenPgpContext factory.
Public methodStatic memberRegister(FuncSecureMimeContext) Registers a default SecureMimeContext factory.
Public methodStatic memberRegister(Type) Registers a default SecureMimeContext or OpenPgpContext.
Public methodSign Sign the content using the specified signer and digest algorithm.
Public methodSignAsync Asynchronously sign the content using the specified signer and digest algorithm.
Public methodSupports Check whether or not the specified protocol is supported by the CryptographyContext.
Public methodToString
(Inherited from Object)
Public methodVerify Verify the specified content using the detached signatureData.
Public methodVerifyAsync Asynchronously verify the specified content using the detached signatureData.
Top
Remarks
Generally speaking, applications should not use a CryptographyContext directly, but rather via higher level APIs such as MultipartSigned, MultipartEncrypted and ApplicationPkcs7Mime.
See Also