GMime.ApplicationPkcs7Mime

g GMime.ApplicationPkcs7Mime GMime.ApplicationPkcs7Mime GMime.Object GMime.Object GMime.Part GMime.Part GMime.Object->GMime.Part GMime.Part->GMime.ApplicationPkcs7Mime GObject.Object GObject.Object GObject.Object->GMime.Object

Subclasses:

None

Methods

Inherited:

GMime.Part (25), GMime.Object (28), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

encrypt (entity, flags, recipients)

class

new (type)

class

sign (entity, userid)

decrypt (flags, session_key, result)

get_smime_type ()

verify (flags)

Virtual Methods

Inherited:

GMime.Part (1), GMime.Object (8), GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_object

GMime.Part

r

parent GMime.Part object

smime_type

GMime.SecureMimeType

r

The smime-type Content-Type parameter.

Class Details

class GMime.ApplicationPkcs7Mime(**kwargs)
Bases:

GMime.Part

Abstract:

No

Structure:

GMime.ApplicationPkcs7MimeClass

An application/pkcs7-mime MIME part.

classmethod encrypt(entity, flags, recipients)
Parameters:
Raises:

GLib.Error

Returns:

a new GMime.ApplicationPkcs7Mime object on success or None on fail. If encrypting fails, an exception will be set on err to provide information as to why the failure occurred.

Return type:

GMime.ApplicationPkcs7Mime or None

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:

GMime.ApplicationPkcs7Mime

Creates a new application/pkcs7-mime object.

classmethod sign(entity, userid)
Parameters:
Raises:

GLib.Error

Returns:

a new GMime.ApplicationPkcs7Mime object on success or None on fail. If signing fails, an exception will be set on err to provide information as to why the failure occurred.

Return type:

GMime.ApplicationPkcs7Mime or None

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:
Raises:

GLib.Error

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 or None

Attempts to decrypt the encrypted application/pkcs7-mime part.

When non-None, session_key should be a None-terminated string, such as the one returned by GMime.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-allocated GMime.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:

GMime.SecureMimeType

Gets the smime-type value of the Content-Type header.

verify(flags)
Parameters:

flags (GMime.VerifyFlags) – a GMime.VerifyFlags

Raises:

GLib.Error

Returns:

a new GMime.SignatureList object on success or None 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 or None, entity: GMime.Object)

Attempts to verify the signed self part and extract the original MIME entity.