Camel.CipherContext
Description: Reference for Camel.CipherContext

### Class

# CamelCipherContext

#### Description [src]

    class Camel.CipherContext : GObject.Object
    {
      CamelCipherContextPrivate* priv
    }

Encryption and digital signature interface.

`CamelCipherContext` is an abstract base class that provides a unified interface for encrypting, signing, decrypting, and verifying `CamelMimePart` message parts.

Concrete implementations include `CamelGpgContext` for OpenPGP/GnuPG and `CamelSMIMEContext` for S/MIME.

Each implementation sets protocol strings (sign_protocol, encrypt_protocol, key_protocol) that are used to populate the appropriate MIME header fields in signed and encrypted parts.

Because a single message part may have multiple layers of signing or encryption using different algorithms, the validity result is represented as a tree of `CamelCipherValidity` structures, each describing the signature or encryption status of one layer.

#### Hierarchy

#### Ancestors

- GObject

#### Descendants

- CamelGpgContext
- CamelSMIMEContext

#### Constructors

###### camel_cipher_context_new

This creates a new CamelCipherContext object which is used to sign, verify, encrypt and decrypt streams.

#### Functions

###### camel_cipher_context_error_quark

No description available.

#### Instance methods

###### camel_cipher_context_decrypt

Asynchronously decrypts `ipart` into `opart`.

since: 3.0

###### camel_cipher_context_decrypt_finish

Finishes the operation started with camel_cipher_context_decrypt().

since: 3.0

###### camel_cipher_context_decrypt_sync

Decrypts `ipart` into `opart`.

since: 3.0

###### camel_cipher_context_encrypt

Asynchronously encrypts the clear-text `ipart` and writes the resulting cipher-text to `opart`.

since: 3.0

###### camel_cipher_context_encrypt_finish

Finishes the operation started with camel_cipher_context_encrypt().

since: 3.0

###### camel_cipher_context_encrypt_sync

Encrypts the clear-text `ipart` and writes the resulting cipher-text to `opart`.

since: 3.0

###### camel_cipher_context_get_session

No description available.

since: 2.32

###### camel_cipher_context_hash_to_id

No description available.

###### camel_cipher_context_id_to_hash

No description available.

###### camel_cipher_context_sign

Asynchronously converts the (unsigned) part `ipart` into a new self-contained MIME part `opart`. This may be a multipart/signed part, or a simple part for enveloped types.

since: 3.0

###### camel_cipher_context_sign_finish

Finishes the operation started with camel_cipher_context_sign().

since: 3.0

###### camel_cipher_context_sign_sync

Converts the (unsigned) part `ipart` into a new self-contained MIME part `opart`. This may be a multipart/signed part, or a simple part for enveloped types.

since: 3.0

###### camel_cipher_context_verify

Asynchronously verifies the signature.

since: 3.0

###### camel_cipher_context_verify_finish

Finishes the operation started with camel_cipher_context_verify().

since: 3.0

###### camel_cipher_context_verify_sync

Verifies the signature.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Camel.CipherContext:session

The corresponding `CamelSession`.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct CamelCipherContextClass {
      GObjectClass parent_class;
      const gchar* sign_protocol;
      const gchar* encrypt_protocol;
      const gchar* key_protocol;
      CamelCipherHash (* id_to_hash) (
        CamelCipherContext* context,
        const gchar* id
      );
      const gchar* (* hash_to_id) (
        CamelCipherContext* context,
        CamelCipherHash hash
      );
      gboolean (* sign_sync) (
        CamelCipherContext* context,
        const gchar* userid,
        CamelCipherHash hash,
        CamelMimePart* ipart,
        CamelMimePart* opart,
        GCancellable* cancellable,
        GError** error
      );
      CamelCipherValidity* (* verify_sync) (
        CamelCipherContext* context,
        CamelMimePart* ipart,
        GCancellable* cancellable,
        GError** error
      );
      gboolean (* encrypt_sync) (
        CamelCipherContext* context,
        const gchar* userid,
        GPtrArray* recipients,
        CamelMimePart* ipart,
        CamelMimePart* opart,
        GCancellable* cancellable,
        GError** error
      );
      CamelCipherValidity* (* decrypt_sync) (
        CamelCipherContext* context,
        CamelMimePart* ipart,
        CamelMimePart* opart,
        GCancellable* cancellable,
        GError** error
      );
      gpointer reserved;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.

`sign_protocol: const gchar*`

  No description available.

`encrypt_protocol: const gchar*`

  No description available.

`key_protocol: const gchar*`

  No description available.

`id_to_hash: CamelCipherHash (* id_to_hash) ( CamelCipherContext* context, const gchar* id )`

  No description available.

`hash_to_id: const gchar* (* hash_to_id) ( CamelCipherContext* context, CamelCipherHash hash )`

  No description available.

`sign_sync: gboolean (* sign_sync) ( CamelCipherContext* context, const gchar* userid, CamelCipherHash hash, CamelMimePart* ipart, CamelMimePart* opart, GCancellable* cancellable, GError** error )`

  No description available.

`verify_sync: CamelCipherValidity* (* verify_sync) ( CamelCipherContext* context, CamelMimePart* ipart, GCancellable* cancellable, GError** error )`

  No description available.

`encrypt_sync: gboolean (* encrypt_sync) ( CamelCipherContext* context, const gchar* userid, GPtrArray* recipients, CamelMimePart* ipart, CamelMimePart* opart, GCancellable* cancellable, GError** error )`

  No description available.

`decrypt_sync: CamelCipherValidity* (* decrypt_sync) ( CamelCipherContext* context, CamelMimePart* ipart, CamelMimePart* opart, GCancellable* cancellable, GError** error )`

  No description available.

`reserved: gpointer`

  No description available.

#### Virtual methods

###### Camel.CipherContextClass.decrypt_sync

Decrypts `ipart` into `opart`.

since: 3.0

###### Camel.CipherContextClass.encrypt_sync

Encrypts the clear-text `ipart` and writes the resulting cipher-text to `opart`.

since: 3.0

###### Camel.CipherContextClass.hash_to_id

No description available.

###### Camel.CipherContextClass.id_to_hash

No description available.

###### Camel.CipherContextClass.sign_sync

Converts the (unsigned) part `ipart` into a new self-contained MIME part `opart`. This may be a multipart/signed part, or a simple part for enveloped types.

since: 3.0

###### Camel.CipherContextClass.verify_sync

Verifies the signature.