GMimeMultpartEncrypted

GMimeMultpartEncrypted — Encrypted MIME multiparts

Synopsis

                    GMimeMultipartEncrypted;
GMimeMultipartEncrypted * g_mime_multipart_encrypted_new
                                                        (void);
int                 g_mime_multipart_encrypted_encrypt  (GMimeMultipartEncrypted *mpe,
                                                         GMimeObject *content,
                                                         GMimeCipherContext *ctx,
                                                         gboolean sign,
                                                         const char *userid,
                                                         GPtrArray *recipients,
                                                         GError **err);
GMimeObject *       g_mime_multipart_encrypted_decrypt  (GMimeMultipartEncrypted *mpe,
                                                         GMimeCipherContext *ctx,
                                                         GError **err);
const GMimeSignatureValidity * g_mime_multipart_encrypted_get_signature_validity
                                                        (GMimeMultipartEncrypted *mpe);

Object Hierarchy

  GObject
   +----GMimeObject
         +----GMimeMultipart
               +----GMimeMultipartEncrypted

Description

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

Details

GMimeMultipartEncrypted

typedef struct _GMimeMultipartEncrypted GMimeMultipartEncrypted;

A multipart/encrypted MIME part.


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 ()

int                 g_mime_multipart_encrypted_encrypt  (GMimeMultipartEncrypted *mpe,
                                                         GMimeObject *content,
                                                         GMimeCipherContext *ctx,
                                                         gboolean sign,
                                                         const char *userid,
                                                         GPtrArray *recipients,
                                                         GError **err);

Attempts to encrypt (and conditionally sign) the content MIME part to the public keys of recipients using the ctx encryption context. If successful, the encrypted GMimeObject is set as the encrypted part of the multipart/encrypted object mpe.

mpe : multipart/encrypted object
content : MIME part to encrypt
ctx : encryption cipher context
sign : TRUE if the content should also be signed or FALSE otherwise
userid : user id to use for signing (only used if sign is TRUE)
recipients : an array of recipients to encrypt to
err : a GError
Returns : 0 on success or -1 on fail. If the encryption fails, an exception will be set on err to provide information as to why the failure occured.

g_mime_multipart_encrypted_decrypt ()

GMimeObject *       g_mime_multipart_encrypted_decrypt  (GMimeMultipartEncrypted *mpe,
                                                         GMimeCipherContext *ctx,
                                                         GError **err);

Attempts to decrypt the encrypted MIME part contained within the multipart/encrypted object mpe using the ctx decryption context.

If validity is non-NULL, then on a successful decrypt operation, it will be updated to point to a newly-allocated GMimeSignatureValidity with signature status information.

mpe : multipart/encrypted object
ctx : decryption cipher context
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 occured.

g_mime_multipart_encrypted_get_signature_validity ()

const GMimeSignatureValidity * g_mime_multipart_encrypted_get_signature_validity
                                                        (GMimeMultipartEncrypted *mpe);

Gets the signature validity of the encrypted MIME part.

Note: This is only useful after calling g_mime_multipart_encrypted_decrypt().

See Also

GMimeMultipart