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) | 
|---|
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.CipherContextobject which is used to sign, verify, encrypt and decrypt streams.
 - 
decrypt(ipart, opart, io_priority, cancellable, callback, *user_data)¶
- Parameters: - ipart (Camel.MimePart) – cipher-textCamel.MimePart
- opart (Camel.MimePart) – clear-textCamel.MimePart
- io_priority (int) – the I/O priority of the request
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – data to pass to the callback function
 - 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. 
- ipart (
 - 
decrypt_finish(result)¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult- Raises: - GLib.Error- Returns: - a validity/encryption status, or - Noneon error- Return type: - Camel.CipherValidity- Finishes the operation started with - Camel.CipherContext.decrypt().- New in version 3.0. 
 - 
decrypt_sync(ipart, opart, cancellable)¶
- Parameters: - ipart (Camel.MimePart) – cipher-textCamel.MimePart
- opart (Camel.MimePart) – clear-textCamel.MimePart
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - a validity/encryption status, or - Noneon error- Return type: - Decrypts ipart into opart. - New in version 3.0. 
- ipart (
 - 
encrypt(userid, recipients, ipart, opart, io_priority, cancellable, callback, *user_data)¶
- Parameters: - userid (str) – key id (or email address) to use when signing, orNoneto not sign
- recipients ([str]) – an array of recipient key IDs and/or email addresses
- ipart (Camel.MimePart) – clear-textCamel.MimePart
- opart (Camel.MimePart) – cipher-textCamel.MimePart
- io_priority (int) – the I/O priority of the request
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – data to pass to the callback function
 - 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. 
- userid (
 - 
encrypt_finish(result)¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult- Raises: - GLib.Error- Returns: - Trueon success,- Falseon 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: - userid (str) – key ID (or email address) to use when signing, orNoneto not sign
- recipients ([str]) – an array of recipient key IDs and/or email addresses
- ipart (Camel.MimePart) – clear-textCamel.MimePart
- opart (Camel.MimePart) – cipher-textCamel.MimePart
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - Return type: - Encrypts (and optionally signs) the clear-text ipart and writes the resulting cipher-text to opart. - New in version 3.0. 
- userid (
 - 
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: - userid (str) – a private key to use to sign the stream
- hash (Camel.CipherHash) – preferred Message-Integrity-Check hash algorithm
- ipart (Camel.MimePart) – inputCamel.MimePart
- opart (Camel.MimePart) – outputCamel.MimePart
- io_priority (int) – the I/O priority of the request
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – data to pass to the callback function
 - Asynchronously converts the (unsigned) - Camel.partipart into a new self-contained MIME- Camel.partopart. This may be a multipart/signed- Camel.part, or a simple- Camel.partfor 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. 
- userid (
 - 
sign_finish(result)¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult- Raises: - GLib.Error- Returns: - Trueon success,- Falseon 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: - userid (str) – a private key to use to sign the stream
- hash (Camel.CipherHash) – preferred Message-Integrity-Check hash algorithm
- ipart (Camel.MimePart) – inputCamel.MimePart
- opart (Camel.MimePart) – outputCamel.MimePart
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - Return type: - Converts the (unsigned) - Camel.partipart into a new self-contained MIME- Camel.partopart. This may be a multipart/signed- Camel.part, or a simple- Camel.partfor enveloped types.- New in version 3.0. 
- userid (
 - 
verify(ipart, io_priority, cancellable, callback, *user_data)¶
- Parameters: - ipart (Camel.MimePart) – theCamel.MimePartto verify
- io_priority (int) – the I/O priority of the request
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – data to pass to the callback function
 - 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. 
- ipart (
 - 
verify_finish(result)¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult- Raises: - GLib.Error- Returns: - a - Camel.CipherValiditystructure containing information about the integrity of the input stream, or- Noneon 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: - ipart (Camel.MimePart) – theCamel.MimePartto verify
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - a - Camel.CipherValiditystructure containing information about the integrity of the input stream, or- Noneon failure to execute at all- Return type: - Verifies the signature. 
- ipart (
 - 
do_decrypt_sync(ipart, opart, cancellable) virtual¶
- Parameters: - ipart (Camel.MimePart) – cipher-textCamel.MimePart
- opart (Camel.MimePart) – clear-textCamel.MimePart
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - a validity/encryption status, or - Noneon error- Return type: - Decrypts ipart into opart. - New in version 3.0. 
- ipart (
 - 
do_encrypt_sync(userid, recipients, ipart, opart, cancellable) virtual¶
- Parameters: - userid (str) – key ID (or email address) to use when signing, orNoneto not sign
- recipients ([str]) – an array of recipient key IDs and/or email addresses
- ipart (Camel.MimePart) – clear-textCamel.MimePart
- opart (Camel.MimePart) – cipher-textCamel.MimePart
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - Return type: - Encrypts (and optionally signs) the clear-text ipart and writes the resulting cipher-text to opart. - New in version 3.0. 
- userid (
 - 
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: - userid (str) – a private key to use to sign the stream
- hash (Camel.CipherHash) – preferred Message-Integrity-Check hash algorithm
- ipart (Camel.MimePart) – inputCamel.MimePart
- opart (Camel.MimePart) – outputCamel.MimePart
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - Return type: - Converts the (unsigned) - Camel.partipart into a new self-contained MIME- Camel.partopart. This may be a multipart/signed- Camel.part, or a simple- Camel.partfor enveloped types.- New in version 3.0. 
- userid (
 - 
do_verify_sync(ipart, cancellable) virtual¶
- Parameters: - ipart (Camel.MimePart) – theCamel.MimePartto verify
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - a - Camel.CipherValiditystructure containing information about the integrity of the input stream, or- Noneon failure to execute at all- Return type: - Verifies the signature. 
- ipart (
 
- 
classmethod 
Property Details¶
- 
Camel.CipherContext.props.session¶
- Name: - session- Type: - Camel.Session- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY