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
,GMimeCryptoContext *ctx
,gboolean sign
,const char *userid
,GMimeDigestAlgo digest
,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 context |
|
sign |
|
|
userid |
user id to use for signing (only used if |
|
digest |
digest algorithm to use when signing |
|
recipients |
an array of recipients to encrypt to. |
[element-type utf8] |
err |
a GError |
GMimeObject * g_mime_multipart_encrypted_decrypt (GMimeMultipartEncrypted *mpe
,GMimeCryptoContext *ctx
,GMimeDecryptResult **result
,GError **err
);
Attempts to decrypt the encrypted MIME part contained within the
multipart/encrypted object mpe
using the ctx
decryption context.
If result
is non-NULL
, then on a successful decrypt operation, it will be
updated to point to a newly-allocated GMimeDecryptResult with signature
status information as well as a list of recipients that the part was
encrypted to.
mpe |
multipart/encrypted object |
|
ctx |
decryption context |
|
result |
a GMimeDecryptionResult |
|
err |
a GError |
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.
GMimeObject * g_mime_multipart_encrypted_decrypt_session (GMimeMultipartEncrypted *mpe
,GMimeCryptoContext *ctx
,const char *session_key
,GMimeDecryptResult **result
,GError **err
);
Attempts to decrypt the encrypted MIME part contained within the
multipart/encrypted object mpe
using the ctx
decryption context
trying only the supplied session key. If session_key
is
non-NULL
, but is not valid for the ciphertext, the decryption will
fail even if other available secret key material may have been able
to decrypt it. If session_key
is NULL
, this does the same thing
as g_mime_multipart_encrypted_decrypt()
.
When non-NULL
, session_key
should be a NULL
-terminated string,
such as the one returned by g_mime_decrypt_result_get_session_key()
from a previous decryption.
If result
is non-NULL
, then on a successful decrypt operation, it will be
updated to point to a newly-allocated GMimeDecryptResult with signature
status information as well as a list of recipients that the part was
encrypted to.
mpe |
multipart/encrypted object |
|
ctx |
decryption context |
|
session_key |
session key to use |
|
result |
a GMimeDecryptionResult |
|
err |
a GError |
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.