Click or drag to resize
MimeKit

OpenPgpContext Class

An abstract OpenPGP cryptography context which can be used for PGP/MIME.
Inheritance Hierarchy

Namespace:  MimeKit.Cryptography
Assembly:  MimeKit (in MimeKit.dll) Version: 2.1.0.0
Syntax
C#
public abstract class OpenPgpContext : CryptographyContext

The OpenPgpContext type exposes the following members.

Constructors
  NameDescription
Protected methodOpenPgpContext
Initializes a new instance of the OpenPgpContext class.
Protected methodOpenPgpContext(String, String)
Initializes a new instance of the OpenPgpContext class.
Top
Properties
  NameDescription
Public propertyAutoKeyRetrieve
Get or set whether unknown PGP keys should automtically be retrieved.
Public propertyDefaultEncryptionAlgorithm
Get or set the default encryption algorithm.
Protected propertyDigestAlgorithmRank
Get the preferred rank order for the digest algorithms; from the most preferred to the least.
(Inherited from CryptographyContext.)
Public propertyEnabledDigestAlgorithms
Get the enabled digest algorithms in ranked order.
(Inherited from CryptographyContext.)
Public propertyEnabledEncryptionAlgorithms
Get the enabled encryption algorithms in ranked order.
(Inherited from CryptographyContext.)
Protected propertyEncryptionAlgorithmRank
Get the preferred rank order for the encryption algorithms; from the most preferred to the least.
(Inherited from CryptographyContext.)
Public propertyEncryptionProtocol
Get the encryption protocol.
(Overrides CryptographyContextEncryptionProtocol.)
Public propertyKeyExchangeProtocol
Get the key exchange protocol.
(Overrides CryptographyContextKeyExchangeProtocol.)
Public propertyKeyServer
Get or set the key server to use when automatically retrieving keys.
Public propertyPublicKeyRingBundle
Get the public keyring bundle.
Protected propertyPublicKeyRingPath
Get the public keyring path.
Public propertySecretKeyRingBundle
Get the secret keyring bundle.
Protected propertySecretKeyRingPath
Get the secret keyring path.
Public propertySignatureProtocol
Get the signature protocol.
(Overrides CryptographyContextSignatureProtocol.)
Top
Methods
  NameDescription
Public methodCanEncrypt
Check whether or not the cryptography context can encrypt to a particular recipient.
(Overrides CryptographyContextCanEncrypt(MailboxAddress).)
Public methodCanSign
Check whether or not a particular mailbox address can be used for signing.
(Overrides CryptographyContextCanSign(MailboxAddress).)
Public methodDecrypt(Stream, CancellationToken)
Decrypts the specified encryptedData.
(Overrides CryptographyContextDecrypt(Stream, CancellationToken).)
Public methodDecrypt(Stream, DigitalSignatureCollection, CancellationToken)
Decrypts the specified encryptedData and extracts the digital signers if the content was also signed.
Public methodDecryptTo
Decrypt an encrypted stream and extract the digital signers if the content was also signed.
Public methodDecryptToAsync
Asynchronously decrypt an encrypted stream and extract the digital signers if the content was also signed.
Public methodDelete(PgpPublicKeyRing)
Delete a public pgp keyring.
Public methodDelete(PgpSecretKeyRing)
Delete a secret pgp keyring.
Public methodDisable(DigestAlgorithm)
Disable the digest algorithm.
(Inherited from CryptographyContext.)
Public methodDisable(EncryptionAlgorithm)
Disable the encryption algorithm.
(Inherited from CryptographyContext.)
Public methodDispose
Releases all resources used by the CryptographyContext object.
(Inherited from CryptographyContext.)
Protected methodDispose(Boolean)
Releases all resources used by the OpenPgpContext object.
(Overrides CryptographyContextDispose(Boolean).)
Public methodEnable(DigestAlgorithm)
Enable the digest algorithm.
(Inherited from CryptographyContext.)
Public methodEnable(EncryptionAlgorithm)
Enable the encryption algorithm.
(Inherited from CryptographyContext.)
Public methodEncrypt(IEnumerablePgpPublicKey, Stream)
Encrypt the specified content for the specified recipients.
Public methodEncrypt(IEnumerableMailboxAddress, Stream)
Encrypt the specified content for the specified recipients.
(Overrides CryptographyContextEncrypt(IEnumerableMailboxAddress, Stream).)
Public methodEncrypt(EncryptionAlgorithm, IEnumerableMailboxAddress, Stream)
Encrypt the specified content for the specified recipients.
Public methodEncrypt(EncryptionAlgorithm, IEnumerablePgpPublicKey, Stream)
Encrypt the specified content for the specified recipients.
Public methodEnumeratePublicKeyRings
Enumerate all public keyrings.
Public methodEnumeratePublicKeyRings(MailboxAddress)
Enumerate the public keyrings for a particular mailbox.
Public methodEnumeratePublicKeys
Enumerate all public keys.
Public methodEnumeratePublicKeys(MailboxAddress)
Enumerate the public keys for a particular mailbox.
Public methodEnumerateSecretKeyRings
Enumerate all secret keyrings.
Public methodEnumerateSecretKeyRings(MailboxAddress)
Enumerate the secret keyrings for a particular mailbox.
Public methodEnumerateSecretKeys
Enumerate all secret keys.
Public methodEnumerateSecretKeys(MailboxAddress)
Enumerate the secret keys for a particular mailbox.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExport(PgpPublicKeyRingBundle)
Export the specified public keys.
Public methodExport(IEnumerablePgpPublicKey)
Exports the specified public keys.
Public methodExport(IEnumerableMailboxAddress)
Exports the public keys for the specified mailboxes.
(Overrides CryptographyContextExport(IEnumerableMailboxAddress).)
Public methodExport(PgpPublicKeyRingBundle, Stream, Boolean)
Export the public keyring bundle.
Public methodExport(IEnumerablePgpPublicKey, Stream, Boolean)
Export the specified public keys.
Public methodExport(IEnumerableMailboxAddress, Stream, Boolean)
Export the public keyrings 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 methodGenerateKeyPair
Generate a new key pair.
Public methodStatic memberGetDigestAlgorithm(HashAlgorithmTag)
Gets the equivalent DigestAlgorithm for the specified HashAlgorithmTag.
Public methodGetDigestAlgorithm(String)
Get the digest algorithm from the micalg parameter value in a multipart/signed part.
(Overrides CryptographyContextGetDigestAlgorithm(String).)
Public methodGetDigestAlgorithmName
Get the string name of the digest algorithm for use with the micalg parameter of a multipart/signed part.
(Overrides CryptographyContextGetDigestAlgorithmName(DigestAlgorithm).)
Public methodStatic memberGetHashAlgorithm
Gets the equivalent HashAlgorithmTag for the specified DigestAlgorithm.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Protected methodGetPasswordForKey
Gets the password for key.
Protected methodGetPrivateKey
Gets the private key from the specified secret key.
Protected methodGetPublicKey
Get the public key associated with the mailbox address.
Public methodStatic memberGetPublicKeyAlgorithm
Gets the equivalent PublicKeyAlgorithm for the specified PublicKeyAlgorithmTag.
Protected methodGetPublicKeys
Get the public keys for the specified mailbox addresses.
Protected methodGetSigningKey
Get the signing key associated with the mailbox address.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodImport(PgpPublicKeyRing)
Imports a public pgp keyring.
Public methodImport(PgpPublicKeyRingBundle)
Imports a public pgp keyring bundle.
Public methodImport(PgpSecretKeyRing)
Imports a secret pgp keyring.
Public methodImport(PgpSecretKeyRingBundle)
Imports a secret pgp keyring bundle.
Public methodImport(Stream)
Imports public pgp keys from the specified stream.
(Overrides CryptographyContextImport(Stream).)
Public methodIsEnabled(DigestAlgorithm)
Check whether the specified digest algorithm is enabled.
(Inherited from CryptographyContext.)
Public methodIsEnabled(EncryptionAlgorithm)
Check whether the specified encryption algorithm is enabled.
(Inherited from CryptographyContext.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodSavePublicKeyRingBundle
Saves the public key-ring bundle.
Protected methodSaveSecretKeyRingBundle
Saves the secret key-ring bundle.
Public methodSign(PgpSecretKey, DigestAlgorithm, Stream)
Cryptographically signs the content.
Public methodSign(MailboxAddress, DigestAlgorithm, Stream)
Cryptographically signs the content.
(Overrides CryptographyContextSign(MailboxAddress, DigestAlgorithm, Stream).)
Public methodSignAndEncrypt(PgpSecretKey, DigestAlgorithm, IEnumerablePgpPublicKey, Stream)
Cryptographically sign and encrypt the specified content for the specified recipients.
Public methodSignAndEncrypt(MailboxAddress, DigestAlgorithm, IEnumerableMailboxAddress, Stream)
Cryptographically sign and encrypt the specified content for the specified recipients.
Public methodSignAndEncrypt(PgpSecretKey, DigestAlgorithm, EncryptionAlgorithm, IEnumerablePgpPublicKey, Stream)
Cryptographically sign and encrypt the specified content for the specified recipients.
Public methodSignAndEncrypt(MailboxAddress, DigestAlgorithm, EncryptionAlgorithm, IEnumerableMailboxAddress, Stream)
Cryptographically sign and encrypt the specified content for the specified recipients.
Public methodSignKey
Sign a public key.
Public methodSupports
Check whether or not the specified protocol is supported.
(Overrides CryptographyContextSupports(String).)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodVerify
Verify the specified content using the detached signatureData.
(Overrides CryptographyContextVerify(Stream, Stream, CancellationToken).)
Public methodVerifyAsync
Asynchronously verify the specified content using the detached signatureData.
(Overrides CryptographyContextVerifyAsync(Stream, Stream, CancellationToken).)
Top
Remarks
Generally speaking, applications should not use a OpenPgpContext directly, but rather via higher level APIs such as MultipartSigned and MultipartEncrypted.
See Also