Camel.CipherContext¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class Camel.CipherContext(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(session)¶
- Parameters:
session (
Camel.SessionorNone) – aCamel.Session- Returns:
the new
Camel.CipherContext- Return type:
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.MimePartopart (
Camel.MimePart) – clear-textCamel.MimePartio_priority (
int) – the I/O priority of the requestcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNonecallback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfieduser_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.
- decrypt_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
a validity/encryption status, or
Noneon error- Return type:
Finishes the operation started with
Camel.CipherContext.decrypt().New in version 3.0.
- decrypt_sync(ipart, opart, cancellable)¶
- Parameters:
ipart (
Camel.MimePart) – cipher-textCamel.MimePartopart (
Camel.MimePart) – clear-textCamel.MimePartcancellable (
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.
- encrypt(userid, recipients, ipart, opart, io_priority, cancellable, callback, *user_data)¶
- Parameters:
recipients ([
str]) – an array of recipient key IDs and/or email addressesipart (
Camel.MimePart) – clear-textCamel.MimePartopart (
Camel.MimePart) – cipher-textCamel.MimePartio_priority (
int) – the I/O priority of the requestcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNonecallback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfieduser_data (
objectorNone) – data to pass to the callback function
Asynchronously encrypts 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.Note: The userid is unused,
Noneshould be passed for it.New in version 3.0.
- encrypt_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
- Return type:
Finishes the operation started with
Camel.CipherContext.encrypt().New in version 3.0.
- encrypt_sync(userid, recipients, ipart, opart, cancellable)¶
- Parameters:
recipients ([
str]) – an array of recipient key IDs and/or email addressesipart (
Camel.MimePart) – clear-textCamel.MimePartopart (
Camel.MimePart) – cipher-textCamel.MimePartcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
- Return type:
Encrypts the clear-text ipart and writes the resulting cipher-text to opart.
Note: The userid is unused,
Noneshould be passed for it.New in version 3.0.
- get_session()¶
- Returns:
a
Camel.Sessionthe self had been created with- Return type:
New in version 2.32.
- hash_to_id(hash)¶
- Parameters:
hash (
Camel.CipherHash) –- Return type:
- sign(userid, hash, ipart, opart, io_priority, cancellable, callback, *user_data)¶
- Parameters:
userid (
str) – a private key to use to sign the streamhash (
Camel.CipherHash) – preferred Message-Integrity-Check hash algorithmipart (
Camel.MimePart) – inputCamel.MimePartopart (
Camel.MimePart) – outputCamel.MimePartio_priority (
int) – the I/O priority of the requestcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNonecallback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfieduser_data (
objectorNone) – data to pass to the callback function
Asynchronously converts the (unsigned)
Camel.partipart into a new self-contained MIMECamel.partopart. This may be a multipart/signedCamel.part, or a simpleCamel.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.
- sign_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
- Return type:
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 streamhash (
Camel.CipherHash) – preferred Message-Integrity-Check hash algorithmipart (
Camel.MimePart) – inputCamel.MimePartopart (
Camel.MimePart) – outputCamel.MimePartcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
- Return type:
Converts the (unsigned)
Camel.partipart into a new self-contained MIMECamel.partopart. This may be a multipart/signedCamel.part, or a simpleCamel.partfor enveloped types.New in version 3.0.
- verify(ipart, io_priority, cancellable, callback, *user_data)¶
- Parameters:
ipart (
Camel.MimePart) – theCamel.MimePartto verifyio_priority (
int) – the I/O priority of the requestcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNonecallback (
Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfieduser_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.
- verify_finish(result)¶
- Parameters:
result (
Gio.AsyncResult) – aGio.AsyncResult- Raises:
- Returns:
a
Camel.CipherValiditystructure containing information about the integrity of the input stream, orNoneon failure to execute at all- Return type:
Finishes the operation started with
Camel.CipherContext.verify().New in version 3.0.
- verify_sync(ipart, cancellable)¶
- Parameters:
ipart (
Camel.MimePart) – theCamel.MimePartto verifycancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
a
Camel.CipherValiditystructure containing information about the integrity of the input stream, orNoneon failure to execute at all- Return type:
Verifies the signature.
- do_decrypt_sync(ipart, opart, cancellable) virtual¶
- Parameters:
ipart (
Camel.MimePart) – cipher-textCamel.MimePartopart (
Camel.MimePart) – clear-textCamel.MimePartcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Returns:
a validity/encryption status, or
Noneon error- Return type:
Decrypts ipart into opart.
New in version 3.0.
- do_encrypt_sync(userid, recipients, ipart, opart, cancellable) virtual¶
- Parameters:
recipients ([
str]) – an array of recipient key IDs and/or email addressesipart (
Camel.MimePart) – clear-textCamel.MimePartopart (
Camel.MimePart) – cipher-textCamel.MimePartcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Returns:
- Return type:
Encrypts the clear-text ipart and writes the resulting cipher-text to opart.
Note: The userid is unused,
Noneshould be passed for it.New in version 3.0.
- do_hash_to_id(hash) virtual¶
- Parameters:
hash (
Camel.CipherHash) –- Return type:
- do_sign_sync(userid, hash, ipart, opart, cancellable) virtual¶
- Parameters:
userid (
str) – a private key to use to sign the streamhash (
Camel.CipherHash) – preferred Message-Integrity-Check hash algorithmipart (
Camel.MimePart) – inputCamel.MimePartopart (
Camel.MimePart) – outputCamel.MimePartcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Returns:
- Return type:
Converts the (unsigned)
Camel.partipart into a new self-contained MIMECamel.partopart. This may be a multipart/signedCamel.part, or a simpleCamel.partfor enveloped types.New in version 3.0.
- do_verify_sync(ipart, cancellable) virtual¶
- Parameters:
ipart (
Camel.MimePart) – theCamel.MimePartto verifycancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Returns:
a
Camel.CipherValiditystructure containing information about the integrity of the input stream, orNoneon failure to execute at all- Return type:
Verifies the signature.
Property Details¶
- Camel.CipherContext.props.session¶
- Name:
session- Type:
- Default Value:
- Flags: