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.Session
orNone
) – aCamel.Session
- Returns:
the new
Camel.CipherContext
- Return type:
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:
ipart (
Camel.MimePart
) – cipher-textCamel.MimePart
opart (
Camel.MimePart
) – clear-textCamel.MimePart
io_priority (
int
) – the I/O priority of the requestcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – 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
None
on 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.MimePart
opart (
Camel.MimePart
) – clear-textCamel.MimePart
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
a validity/encryption status, or
None
on 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.MimePart
opart (
Camel.MimePart
) – cipher-textCamel.MimePart
io_priority (
int
) – the I/O priority of the requestcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – 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,
None
should 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.MimePart
opart (
Camel.MimePart
) – cipher-textCamel.MimePart
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
- Return type:
Encrypts the clear-text ipart and writes the resulting cipher-text to opart.
Note: The userid is unused,
None
should be passed for it.New in version 3.0.
- get_session()¶
- Returns:
a
Camel.Session
the 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.MimePart
opart (
Camel.MimePart
) – outputCamel.MimePart
io_priority (
int
) – the I/O priority of the requestcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – data to pass to the callback function
Asynchronously converts the (unsigned)
Camel.part
ipart into a new self-contained MIMECamel.part
opart. This may be a multipart/signedCamel.part
, or a simpleCamel.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
) – 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.MimePart
opart (
Camel.MimePart
) – outputCamel.MimePart
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
- Return type:
Converts the (unsigned)
Camel.part
ipart into a new self-contained MIMECamel.part
opart. This may be a multipart/signedCamel.part
, or a simpleCamel.part
for enveloped types.New in version 3.0.
- verify(ipart, io_priority, cancellable, callback, *user_data)¶
- Parameters:
ipart (
Camel.MimePart
) – theCamel.MimePart
to verifyio_priority (
int
) – the I/O priority of the requestcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – 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.CipherValidity
structure containing information about the integrity of the input stream, orNone
on 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.MimePart
to verifycancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
a
Camel.CipherValidity
structure containing information about the integrity of the input stream, orNone
on failure to execute at all- Return type:
Verifies the signature.
- do_decrypt_sync(ipart, opart, cancellable) virtual¶
- Parameters:
ipart (
Camel.MimePart
) – cipher-textCamel.MimePart
opart (
Camel.MimePart
) – clear-textCamel.MimePart
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Returns:
a validity/encryption status, or
None
on 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.MimePart
opart (
Camel.MimePart
) – cipher-textCamel.MimePart
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Returns:
- Return type:
Encrypts the clear-text ipart and writes the resulting cipher-text to opart.
Note: The userid is unused,
None
should 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.MimePart
opart (
Camel.MimePart
) – outputCamel.MimePart
cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Returns:
- Return type:
Converts the (unsigned)
Camel.part
ipart into a new self-contained MIMECamel.part
opart. This may be a multipart/signedCamel.part
, or a simpleCamel.part
for enveloped types.New in version 3.0.
- do_verify_sync(ipart, cancellable) virtual¶
- Parameters:
ipart (
Camel.MimePart
) – theCamel.MimePart
to verifycancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Returns:
a
Camel.CipherValidity
structure containing information about the integrity of the input stream, orNone
on failure to execute at all- Return type:
Verifies the signature.
Property Details¶
- Camel.CipherContext.props.session¶
- Name:
session
- Type:
- Default Value:
- Flags: