Camel.CipherContext

g Camel.CipherContext Camel.CipherContext GObject.Object GObject.Object GObject.Object->Camel.CipherContext

Subclasses:Camel.GpgContext, Camel.SMIMEContext

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class new (session)
  decrypt (ipart, opart, io_priority, cancellable, callback, *user_data)
  decrypt_finish (result)
  decrypt_sync (ipart, opart, cancellable)
  encrypt (userid, recipients, ipart, opart, io_priority, cancellable, callback, *user_data)
  encrypt_finish (result)
  encrypt_sync (userid, recipients, ipart, opart, cancellable)
  get_session ()
  hash_to_id (hash)
  id_to_hash (id)
  sign (userid, hash, ipart, opart, io_priority, cancellable, callback, *user_data)
  sign_finish (result)
  sign_sync (userid, hash, ipart, opart, cancellable)
  verify (ipart, io_priority, cancellable, callback, *user_data)
  verify_finish (result)
  verify_sync (ipart, cancellable)

Virtual Methods

Inherited:GObject.Object (7)
  do_decrypt_sync (ipart, opart, cancellable)
  do_encrypt_sync (userid, recipients, ipart, opart, cancellable)
  do_hash_to_id (hash)
  do_id_to_hash (id)
  do_sign_sync (userid, hash, ipart, opart, cancellable)
  do_verify_sync (ipart, cancellable)

Properties

Name Type Flags Short Description
session Camel.Session r/w/co  

Signals

Inherited:GObject.Object (1)

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent GObject.Object r  

Class Details

class Camel.CipherContext(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:Camel.CipherContextClass
classmethod new(session)
Parameters:session (Camel.Session) – a Camel.Session
Returns:the new Camel.CipherContext
Return type:Camel.CipherContext

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

decrypt(ipart, opart, io_priority, cancellable, callback, *user_data)
Parameters:

Asynchronously decrypts ipart into opart.

When the operation is finished, callback will be called. You can then call Camel.CipherContext.decrypt_finish() to get the result of the operation.

New in version 3.0.

decrypt_finish(result)
Parameters:result (Gio.AsyncResult) – a Gio.AsyncResult
Raises:GLib.Error
Returns:a validity/encryption status, or None on error
Return type:Camel.CipherValidity

Finishes the operation started with Camel.CipherContext.decrypt().

New in version 3.0.

decrypt_sync(ipart, opart, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a validity/encryption status, or None on error

Return type:

Camel.CipherValidity

Decrypts ipart into opart.

New in version 3.0.

encrypt(userid, recipients, ipart, opart, io_priority, cancellable, callback, *user_data)
Parameters:

Asynchronously encrypts (and optionally signs) the clear-text ipart and writes the resulting cipher-text to opart.

When the operation is finished, callback will be called. You can then call Camel.CipherContext.encrypt_finish() to get the result of the operation.

New in version 3.0.

encrypt_finish(result)
Parameters:result (Gio.AsyncResult) – a Gio.AsyncResult
Raises:GLib.Error
Returns:True on success, False on error
Return type:bool

Finishes the operation started with Camel.CipherContext.encrypt().

New in version 3.0.

encrypt_sync(userid, recipients, ipart, opart, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False on error

Return type:

bool

Encrypts (and optionally signs) the clear-text ipart and writes the resulting cipher-text to opart.

New in version 3.0.

get_session()
Return type:Camel.Session

New in version 2.32.

hash_to_id(hash)
Parameters:hash (Camel.CipherHash) –
Return type:str
id_to_hash(id)
Parameters:id (str) –
Return type:Camel.CipherHash
sign(userid, hash, ipart, opart, io_priority, cancellable, callback, *user_data)
Parameters:

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

When the operation is finished, callback will be called. You can then call Camel.CipherContext.sign_finish() to get the result of the operation.

New in version 3.0.

sign_finish(result)
Parameters:result (Gio.AsyncResult) – a Gio.AsyncResult
Raises:GLib.Error
Returns:True on success, False on error
Return type:bool

Finishes the operation started with Camel.CipherContext.sign().

New in version 3.0.

sign_sync(userid, hash, ipart, opart, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True on success, False on error

Return type:

bool

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

New in version 3.0.

verify(ipart, io_priority, cancellable, callback, *user_data)
Parameters:

Asynchronously verifies the signature.

When the operation is finished, callback will be called. You can then call Camel.CipherContext.verify_finish() to get the result of the operation.

New in version 3.0.

verify_finish(result)
Parameters:result (Gio.AsyncResult) – a Gio.AsyncResult
Raises:GLib.Error
Returns:a Camel.CipherValidity structure containing information about the integrity of the input stream, or None on failure to execute at all
Return type:Camel.CipherValidity

Finishes the operation started with Camel.CipherContext.verify().

New in version 3.0.

verify_sync(ipart, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a Camel.CipherValidity structure containing information about the integrity of the input stream, or None on failure to execute at all

Return type:

Camel.CipherValidity

Verifies the signature.

do_decrypt_sync(ipart, opart, cancellable) virtual
Parameters:
Returns:

a validity/encryption status, or None on error

Return type:

Camel.CipherValidity

Decrypts ipart into opart.

New in version 3.0.

do_encrypt_sync(userid, recipients, ipart, opart, cancellable) virtual
Parameters:
Returns:

True on success, False on error

Return type:

bool

Encrypts (and optionally signs) the clear-text ipart and writes the resulting cipher-text to opart.

New in version 3.0.

do_hash_to_id(hash) virtual
Parameters:hash (Camel.CipherHash) –
Return type:str
do_id_to_hash(id) virtual
Parameters:id (str) –
Return type:Camel.CipherHash
do_sign_sync(userid, hash, ipart, opart, cancellable) virtual
Parameters:
Returns:

True on success, False on error

Return type:

bool

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

New in version 3.0.

do_verify_sync(ipart, cancellable) virtual
Parameters:
Returns:

a Camel.CipherValidity structure containing information about the integrity of the input stream, or None on failure to execute at all

Return type:

Camel.CipherValidity

Verifies the signature.

Property Details

Camel.CipherContext.props.session
Name:session
Type:Camel.Session
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY