GMime.MultipartEncrypted¶
- Subclasses:
None
Methods¶
- Inherited:
GMime.Multipart (20), GMime.Object (29), GObject.Object (37)
- Structs:
class |
|
class |
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_object |
r |
parent |
Class Details¶
- class GMime.MultipartEncrypted(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A multipart/encrypted MIME part.
- classmethod encrypt(ctx, entity, sign, userid, flags, recipients)¶
- Parameters:
ctx (
GMime.CryptoContext
) – aGMime.CryptoContext
entity (
GMime.Object
) – MIME part to encryptsign (
bool
) –True
if the content should also be signed orFalse
otherwiseuserid (
str
orNone
) – user id to use for signing (only used if sign isTrue
)flags (
GMime.EncryptFlags
) – aGMime.EncryptFlags
recipients ([
str
]) – an array of recipients to encrypt to
- Raises:
- Returns:
a new
GMime.MultipartEncrypted
object on success orNone
on fail. If encrypting fails, an exception will be set on err to provide information as to why the failure occurred.- Return type:
Attempts to encrypt (and conditionally sign) the entity MIME part to the public keys of recipients using the ctx encryption context. If successful, a new multipart/encrypted object is returned.
- classmethod new()¶
- Returns:
an empty MIME multipart/encrypted object.
- Return type:
Creates a new MIME multipart/encrypted object.
- decrypt(flags, session_key)¶
- Parameters:
flags (
GMime.DecryptFlags
) – aGMime.DecryptFlags
- Raises:
- Returns:
the decrypted MIME part on success or
None
on fail. If the decryption fails, an exception will be set on err to provide information as to why the failure occurred.- result:
- Return type:
(
GMime.Object
orNone
, result:GMime.DecryptResult
)
Attempts to decrypt the encrypted MIME part contained within the multipart/encrypted object self.
When non-
None
, session_key should be aNone
-terminated string, such as the one returned byGMime.DecryptResult.get_session_key
() from a previous decryption. If the session_key is not valid, decryption will fail.If result is non-
None
, then on a successful decrypt operation, it will be updated to point to a newly-allocatedGMime.DecryptResult
with signature status information as well as a list of recipients that the part was encrypted to.