Click or drag to resize
MimeKit

CryptographyContext Class

An abstract cryptography context.
Inheritance Hierarchy

Namespace:  MimeKit.Cryptography
Assembly:  MimeKit (in MimeKit.dll) Version: 2.14.0
Syntax
C#
public abstract class CryptographyContext : 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 propertySignatureProtocol
Get the signature protocol.
Top
Methods
  NameDescription
Public methodCanEncrypt
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 methodStatic memberCreate
Creates a new CryptographyContext for the specified protocol.
Public methodDecrypt
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 methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExport
Exports the keys for the specified mailboxes.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(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
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodImport
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
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberRegister(Type)
Registers a default SecureMimeContext or OpenPgpContext.
Public methodStatic memberRegister(FuncOpenPgpContextBase)
Registers a default OpenPgpContext factory.
Public methodStatic memberRegister(FuncSecureMimeContext)
Registers a default SecureMimeContext factory.
Public methodSign
Cryptographically sign the content.
Public methodSupports
Check whether or not the specified protocol is supported by the CryptographyContext.
Public methodToString
Returns a string that represents the current object.
(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