GMime.ApplicationPkcs7Mime¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_object |
r |
parent |
|
smime_type |
r |
The smime-type Content-Type parameter. |
Class Details¶
- class GMime.ApplicationPkcs7Mime(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
An application/pkcs7-mime MIME part.
- classmethod encrypt(entity, flags, recipients)¶
- Parameters:
entity (
GMime.Object
) – aGMime.Object
to encryptflags (
GMime.EncryptFlags
) – aGMime.EncryptFlags
recipients ([
str
]) – an array of recipients to encrypt to
- Raises:
- Returns:
a new
GMime.ApplicationPkcs7Mime
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 the entity MIME part to the public keys of recipients using S/MIME. If successful, a new application/pkcs7-mime object is returned.
- classmethod new(type)¶
- Parameters:
type (
GMime.SecureMimeType
) – The type of S/MIME data contained within the part.- Returns:
an empty application/pkcs7-mime object.
- Return type:
Creates a new application/pkcs7-mime object.
- classmethod sign(entity, userid)¶
- Parameters:
entity (
GMime.Object
) – aGMime.Object
userid (
str
) – the user id to sign with
- Raises:
- Returns:
a new
GMime.ApplicationPkcs7Mime
object on success orNone
on fail. If signing fails, an exception will be set on err to provide information as to why the failure occurred.- Return type:
Attempts to sign the entity MIME part with userid's private key using S/MIME. If successful, a new application/pkcs7-mime object is returned.
- decrypt(flags, session_key, result)¶
- Parameters:
flags (
GMime.DecryptFlags
) – aGMime.DecryptFlags
result (
GMime.DecryptResult
) – the decryption result
- 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.- Return type:
GMime.Object
orNone
Attempts to decrypt the encrypted application/pkcs7-mime part.
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.
- get_smime_type()¶
- Returns:
the smime-type value.
- Return type:
Gets the smime-type value of the Content-Type header.
- verify(flags)¶
- Parameters:
flags (
GMime.VerifyFlags
) – aGMime.VerifyFlags
- Raises:
- Returns:
a new
GMime.SignatureList
object on success orNone
on fail. If the verification fails, an exception will be set on err to provide information as to why the failure occurred.- entity:
the extracted entity
- Return type:
(
GMime.SignatureList
orNone
, entity:GMime.Object
)
Attempts to verify the signed self part and extract the original MIME entity.