| Top |
| #define | CAMEL_CIPHER_CERT_INFO_PROPERTY_PHOTO_FILENAME |
| enum | CamelCipherHash |
| enum | CamelCipherValiditySign |
| enum | CamelCipherValidityEncrypt |
| enum | CamelCipherValidityMode |
| struct | CamelCipherCertInfoProperty |
| struct | CamelCipherCertInfo |
CamelCipherContext * camel_cipher_context_new ();CamelSession *session
This creates a new CamelCipherContext object which is used to sign, verify, encrypt and decrypt streams.
CamelSession * camel_cipher_context_get_session ();CamelCipherContext *context
Since: 2.32
CamelCipherHash camel_cipher_context_id_to_hash (,CamelCipherContext *contextconst);gchar *id
constgchar * camel_cipher_context_hash_to_id (,CamelCipherContext *contextCamelCipherHash hash);
gboolean camel_cipher_context_sign_sync (,CamelCipherContext *contextconst,gchar *useridCamelCipherHash hash,,CamelMimePart *ipart,CamelMimePart *opart,GCancellable *cancellable);GError **error
Converts the (unsigned) part ipart
into a new self-contained MIME
part opart
. This may be a multipart/signed part, or a simple part
for enveloped types.
context |
a |
|
userid |
a private key to use to sign the stream |
|
hash |
preferred Message-Integrity-Check hash algorithm |
|
ipart |
input |
|
opart |
output |
|
cancellable |
optional |
|
error |
return location for a |
Since: 3.0
void camel_cipher_context_sign (,CamelCipherContext *contextconst,gchar *useridCamelCipherHash hash,,CamelMimePart *ipart,CamelMimePart *opart,gint io_priority,GCancellable *cancellable,GAsyncReadyCallback callback);gpointer user_data
Asynchronously converts the (unsigned) part ipart
into a new
self-contained MIME part opart
. This may be a multipart/signed part,
or a simple part for enveloped types.
When the operation is finished, callback
will be called. You can then
call camel_cipher_context_sign_finish() to get the result of the operation.
context |
a |
|
userid |
a private key to use to sign the stream |
|
hash |
preferred Message-Integrity-Check hash algorithm |
|
ipart |
input |
|
opart |
output |
|
io_priority |
the I/O priority of the request |
|
cancellable |
optional |
|
callback |
a |
|
user_data |
data to pass to the callback function |
Since: 3.0
gboolean camel_cipher_context_sign_finish (,CamelCipherContext *context,GAsyncResult *result);GError **error
Finishes the operation started with camel_cipher_context_sign().
context |
a |
|
result |
a |
|
error |
return location for a |
Since: 3.0
CamelCipherValidity * camel_cipher_context_verify_sync (,CamelCipherContext *context,CamelMimePart *ipart,GCancellable *cancellable);GError **error
Verifies the signature.
void camel_cipher_context_verify (,CamelCipherContext *context,CamelMimePart *ipart,gint io_priority,GCancellable *cancellable,GAsyncReadyCallback callback);gpointer user_data
Asynchronously verifies the signature.
When the operation is finished, callback
will be called. You can
then call camel_cipher_context_verify_finish() to get the result of
the operation.
context |
a |
|
ipart |
the |
|
io_priority |
the I/O priority of the request |
|
cancellable |
optional |
|
callback |
a |
|
user_data |
data to pass to the callback function |
Since: 3.0
CamelCipherValidity * camel_cipher_context_verify_finish (,CamelCipherContext *context,GAsyncResult *result);GError **error
Finishes the operation started with camel_cipher_context_verify().
context |
a |
|
result |
a |
|
error |
return location for a |
a NULL
Since: 3.0
gboolean camel_cipher_context_encrypt_sync (,CamelCipherContext *contextconst,gchar *userid,GPtrArray *recipients,CamelMimePart *ipart,CamelMimePart *opart,GCancellable *cancellable);GError **error
Encrypts (and optionally signs) the clear-text ipart
and writes the
resulting cipher-text to opart
.
context |
a |
|
userid |
key ID (or email address) to use when signing, or |
|
recipients |
an array of recipient key IDs and/or email addresses. |
[element-type utf8] |
ipart |
clear-text |
|
opart |
cipher-text |
|
cancellable |
optional |
|
error |
return location for a |
Since: 3.0
void camel_cipher_context_encrypt (,CamelCipherContext *contextconst,gchar *userid,GPtrArray *recipients,CamelMimePart *ipart,CamelMimePart *opart,gint io_priority,GCancellable *cancellable,GAsyncReadyCallback callback);gpointer user_data
Asynchronously encrypts (and optionally signs) the clear-text ipart
and
writes the resulting cipher-text to opart
.
When the operation is finished, callback
will be called. You can
then call camel_cipher_context_encrypt_finish() to get the result of
the operation.
context |
a |
|
userid |
key id (or email address) to use when signing, or |
|
recipients |
an array of recipient key IDs and/or email addresses. |
[element-type utf8] |
ipart |
clear-text |
|
opart |
cipher-text |
|
io_priority |
the I/O priority of the request |
|
cancellable |
optional |
|
callback |
a |
|
user_data |
data to pass to the callback function |
Since: 3.0
gboolean camel_cipher_context_encrypt_finish (,CamelCipherContext *context,GAsyncResult *result);GError **error
Finishes the operation started with camel_cipher_context_encrypt().
context |
a |
|
result |
a |
|
error |
return location for a |
Since: 3.0
CamelCipherValidity * camel_cipher_context_decrypt_sync (,CamelCipherContext *context,CamelMimePart *ipart,CamelMimePart *opart,GCancellable *cancellable);GError **error
Decrypts ipart
into opart
.
context |
a |
|
ipart |
cipher-text |
|
opart |
clear-text |
|
cancellable |
optional |
|
error |
return location for a |
Since: 3.0
void camel_cipher_context_decrypt (,CamelCipherContext *context,CamelMimePart *ipart,CamelMimePart *opart,gint io_priority,GCancellable *cancellable,GAsyncReadyCallback callback);gpointer user_data
Asynchronously decrypts ipart
into opart
.
When the operation is finished, callback
will be called. You can
then call camel_cipher_context_decrypt_finish() to get the result of
the operation.
context |
a |
|
ipart |
cipher-text |
|
opart |
clear-text |
|
io_priority |
the I/O priority of the request |
|
cancellable |
optional |
|
callback |
a |
|
user_data |
data to pass to the callback function |
Since: 3.0
CamelCipherValidity * camel_cipher_context_decrypt_finish (,CamelCipherContext *context,GAsyncResult *result);GError **error
Finishes the operation started with camel_cipher_context_decrypt().
context |
a |
|
result |
a |
|
error |
return location for a |
Since: 3.0
gboolean camel_cipher_validity_get_valid ();CamelCipherValidity *validity
void camel_cipher_validity_set_valid (,CamelCipherValidity *validity);gboolean valid
gchar * camel_cipher_validity_get_description ();CamelCipherValidity *validity
void camel_cipher_validity_set_description (,CamelCipherValidity *validityconst);gchar *description
CamelCipherValidity * camel_cipher_validity_clone ();CamelCipherValidity *vin
gint camel_cipher_validity_add_certinfo (,CamelCipherValidity *vinCamelCipherValidityMode mode,const,gchar *nameconst);gchar *email
Add a cert info to the signer or encrypter info.
vin |
a |
|
mode |
a CamelCipherValidityMode, where to add the additional certificate information |
|
name |
a name to add |
|
an e-mail address to add |
gint camel_cipher_validity_add_certinfo_ex (,CamelCipherValidity *vinCamelCipherValidityMode mode,const,gchar *nameconst,gchar *email,gpointer cert_data,GDestroyNotify cert_data_freeCamelCipherCloneFunc cert_data_clone);
Add a cert info to the signer or encrypter info, with extended data set.
vin |
a |
|
mode |
a CamelCipherValidityMode, where to add the additional certificate information |
|
name |
a name to add |
|
an e-mail address to add |
||
cert_data |
a certificate data, or |
[nullable][destroy cert_data_free] |
cert_data_free |
a destroy function for |
[nullable] |
cert_data_clone |
a copy function for |
[nullable][scope call] |
Since: 2.30
gpointer camel_cipher_validity_get_certinfo_property (,CamelCipherValidity *vinCamelCipherValidityMode mode,,gint info_indexconst);gchar *name
Gets a named property name
value for the given info_index
of the mode
validity part.
vin |
a |
|
mode |
which cipher validity part to use |
|
info_index |
a 0-based index of the requested CamelCipherCertInfo |
|
name |
a property name |
Value of a named property of a CamelCipherCertInfo, or NULL
[transfer none][nullable]
Since: 3.22
void camel_cipher_validity_set_certinfo_property (,CamelCipherValidity *vinCamelCipherValidityMode mode,,gint info_indexconst,gchar *name,gpointer value,GDestroyNotify value_freeCamelCipherCloneFunc value_clone);
Sets a named property name
value value
for the given info_index
of the mode
validity part. If the value
is NULLNULLvalue
also value_free
and value_clone
functions cannot be NULL
vin |
a |
|
mode |
which cipher validity part to use |
|
info_index |
a 0-based index of the requested CamelCipherCertInfo |
|
name |
a property name |
|
value |
a property value, or |
[nullable][destroy value_free] |
value_free |
a free function for the |
[nullable] |
value_clone |
a clone function for the |
[nullable][scope call] |
Since: 3.22
void camel_cipher_validity_envelope (,CamelCipherValidity *parent);CamelCipherValidity *valid
Calculate a conglomerate validity based on wrapping one secure part inside another one.
gpointer camel_cipher_certinfo_get_property (CamelCipherCertInfo *cert_info,const);gchar *name
Gets a named property name
value for the given cert_info
.
Value of a named property of the cert_info
,
or NULLcert_info
and is valid until the cert_info
is freed.
[transfer none][nullable]
Since: 3.22
void camel_cipher_certinfo_set_property (CamelCipherCertInfo *cert_info,const,gchar *name,gpointer value,GDestroyNotify value_freeCamelCipherCloneFunc value_clone);
Sets a named property name
value value
for the given cert_info
.
If the value
is NULLNULLvalue
also value_free
and value_clone
functions cannot be NULL
cert_info |
||
name |
a property name |
|
value |
a property value, or |
[nullable][destroy value_free] |
value_free |
a free function for the |
[nullable] |
value_clone |
a clone function for the |
[nullable][scope call] |
Since: 3.22
gint camel_cipher_canonical_to_stream (,CamelMimePart *part,guint32 flags,CamelStream *ostream,GCancellable *cancellable);GError **error
Writes a part to a stream in a canonicalised format, suitable for signing/encrypting.
The transfer encoding paramaters for the part may be changed by this function.
#define CAMEL_CIPHER_CERT_INFO_PROPERTY_PHOTO_FILENAME "photo-filename"
Name of the photo-filename property which can be stored on a CamelCipherCertInfo.
Since: 3.22
struct CamelCipherCertInfoProperty {
gchar *name;
gpointer value;
GDestroyNotify value_free;
CamelCipherCloneFunc value_clone;
};
struct CamelCipherCertInfo {
gchar *name; /* common name */
gchar *email;
gpointer cert_data; /* custom certificate data; can be NULL */
GDestroyNotify cert_data_free; /* called to free cert_data; can be NULL only if cert_data is NULL */
CamelCipherCloneFunc cert_data_clone; /* called to clone cert_data; can be NULL only if cert_data is NULL */
GSList *properties; /* CamelCipherCertInfoProperty * */
};