| Top |
A GMimeMultipartEncrypted part is a special subclass of GMimeMultipart to make it easier to manipulate the multipart/encrypted MIME type.
GMimeMultipartEncrypted *
g_mime_multipart_encrypted_new (void);
Creates a new MIME multipart/encrypted object.
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
.
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.
For information regarding the signature status (in cases where the
MIME part was both encrypted and signed), you may wish to check the
results of g_mime_multipart_encrypted_get_signature_validity().
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.
Note: On success, the decrypted MIME part is cached internally and so the returned GMimeObject must NOT be unreffed.
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().