GMimeMultipartEncrypted

GMimeMultipartEncrypted — Encrypted MIME multiparts

Functions

Types and Values

Description

A GMimeMultipartEncrypted part is a special subclass of GMimeMultipart to make it easier to manipulate the multipart/encrypted MIME type.

Functions

g_mime_multipart_encrypted_new ()

GMimeMultipartEncrypted *
g_mime_multipart_encrypted_new (void);

Creates a new MIME multipart/encrypted object.

Returns

an empty MIME multipart/encrypted object.


g_mime_multipart_encrypted_encrypt ()

GMimeMultipartEncrypted *
g_mime_multipart_encrypted_encrypt (gpgme_ctx_t ctx,
                                    GMimeEntity *entity,
                                    gboolean sign,
                                    gpgme_encrypt_flags_t flags,
                                    gpgme_key_t *recipients,
                                    gpgme_key_t *hidden_recipients,
                                    gpgme_encrypt_result_t *encrypt_result,
                                    gpgme_sign_result_t *sign_result,
                                    GError **err);

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. Hidden recipients receive the same content without exposing their key IDs. See g_mime_gpgme_encrypt() for recipient-array and encryption-flag semantics.

[skip]

Parameters

ctx

a borrowed GPGME OpenPGP context

 

entity

MIME part to encrypt

 

sign

TRUE if the content should also be signed or FALSE otherwise

 

flags

native GPGME encryption flags

 

recipients

borrowed NULL-terminated recipient keys.

[nullable]

hidden_recipients

borrowed NULL-terminated hidden recipient keys.

[nullable]

encrypt_result

a retained encryption result.

[out][optional]

sign_result

a retained signing result.

[out][optional]

err

a GError

 

Returns

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

[nullable][transfer full]


g_mime_multipart_encrypted_decrypt ()

GMimeEntity *
g_mime_multipart_encrypted_decrypt (GMimeMultipartEncrypted *encrypted,
                                    gpgme_ctx_t ctx,
                                    gpgme_decrypt_result_t *decrypt_result,
                                    gpgme_verify_result_t *verify_result,
                                    GError **err);

Attempts to decrypt the encrypted MIME part contained within the multipart/encrypted object encrypted . Only surrounding ASCII linear whitespace is removed from the protocol parameter.

Embedded signatures are verified. Configure session-key and network policies on ctx directly. Returned native results must be released even if parsing the decrypted MIME entity fails. Decryption alone does not authenticate it.

[skip]

Parameters

encrypted

a GMimeMultipartEncrypted

 

ctx

a borrowed GPGME OpenPGP context

 

decrypt_result

a retained decryption result.

[out][optional]

verify_result

a retained verification result.

[out][optional]

err

a GError

 

Returns

the decrypted MIME part on success or NULL on fail. If the decryption fails, an exception will be set on err to provide information as to why the failure occurred.

[nullable][transfer full]

Types and Values

GMimeMultipartEncrypted

typedef struct _GMimeMultipartEncrypted GMimeMultipartEncrypted;

A multipart/encrypted MIME part.

See Also

GMimeMultipart