| GMime Library Reference Manual |
|---|
enum GMimeCipherHash; struct GMimeCipherContext; struct GMimeCipherValidity; GMimeCipherHash g_mime_cipher_hash_id (GMimeCipherContext *ctx, const char *hash); const char* g_mime_cipher_hash_name (GMimeCipherContext *ctx, GMimeCipherHash hash); int g_mime_cipher_sign (GMimeCipherContext *ctx, const char *userid, GMimeCipherHash hash, GMimeStream *istream, GMimeStream *ostream,GError **err); GMimeCipherValidity* g_mime_cipher_verify (GMimeCipherContext *ctx, GMimeCipherHash hash, GMimeStream *istream, GMimeStream *sigstream,GError **err); int g_mime_cipher_encrypt (GMimeCipherContext *ctx,gboolean sign, const char *userid,GPtrArray *recipients, GMimeStream *istream, GMimeStream *ostream,GError **err); int g_mime_cipher_decrypt (GMimeCipherContext *ctx, GMimeStream *istream, GMimeStream *ostream,GError **err); int g_mime_cipher_import_keys (GMimeCipherContext *ctx, GMimeStream *istream,GError **err); int g_mime_cipher_export_keys (GMimeCipherContext *ctx,GPtrArray *keys, GMimeStream *ostream,GError **err); void g_mime_cipher_validity_init (GMimeCipherValidity *validity); GMimeCipherValidity* g_mime_cipher_validity_new (void); void g_mime_cipher_validity_clear (GMimeCipherValidity *validity); void g_mime_cipher_validity_free (GMimeCipherValidity *validity);gboolean g_mime_cipher_validity_get_valid (GMimeCipherValidity *validity); void g_mime_cipher_validity_set_valid (GMimeCipherValidity *validity,gboolean valid); const char* g_mime_cipher_validity_get_description (GMimeCipherValidity *validity); void g_mime_cipher_validity_set_description (GMimeCipherValidity *validity, const char *description);
typedef enum {
GMIME_CIPHER_HASH_DEFAULT,
GMIME_CIPHER_HASH_MD2,
GMIME_CIPHER_HASH_MD5,
GMIME_CIPHER_HASH_SHA1,
GMIME_CIPHER_HASH_RIPEMD160,
GMIME_CIPHER_HASH_TIGER192,
GMIME_CIPHER_HASH_HAVAL5160
} GMimeCipherHash;struct GMimeCipherContext {
GObject parent_object;
GMimeSession *session;
/* these must be set by the subclass */
const char *sign_protocol;
const char *encrypt_protocol;
const char *key_protocol;
};GMimeCipherHash g_mime_cipher_hash_id (GMimeCipherContext *ctx, const char *hash);
Gets the hash id based on the hash name hash.
| ctx : | Cipher Context |
| hash : | hash name |
| Returns : | the equivalent hash id or |
const char* g_mime_cipher_hash_name (GMimeCipherContext *ctx, GMimeCipherHash hash);
Gets the hash name based on the hash id hash.
| ctx : | Cipher Context |
| hash : | hash id |
| Returns : | the equivalent hash name or NULL on fail. |
int g_mime_cipher_sign (GMimeCipherContext *ctx, const char *userid, GMimeCipherHash hash, GMimeStream *istream, GMimeStream *ostream,GError **err);
Signs the input stream and writes the resulting signature to the output stream.
| ctx : | Cipher Context |
| userid : | private key to use to sign the stream |
| hash : | preferred Message-Integrity-Check hash algorithm |
| istream : | input stream |
| ostream : | output stream |
| err : | exception |
| Returns : | 0 on success or -1 on fail. |
GMimeCipherValidity* g_mime_cipher_verify (GMimeCipherContext *ctx, GMimeCipherHash hash, GMimeStream *istream, GMimeStream *sigstream,GError **err);
Verifies the signature. If istream is a clearsigned stream, you should pass NULL as the sigstream parameter. Otherwise sigstream is assumed to be the signature stream and is used to verify the integirity of the istream.
| ctx : | Cipher Context |
| hash : | secure hash used |
| istream : | input stream |
| sigstream : | optional detached-signature stream |
| err : | exception |
| Returns : | a GMimeCipherValidity structure containing information about the integrity of the input stream or NULL on failure to execute at all. |
int g_mime_cipher_encrypt (GMimeCipherContext *ctx,gboolean sign, const char *userid,GPtrArray *recipients, GMimeStream *istream, GMimeStream *ostream,GError **err);
Encrypts (and optionally signs) the cleartext input stream and writes the resulting ciphertext to the output stream.
| ctx : | Cipher Context |
| sign : | sign as well as encrypt |
| userid : | key id (or email address) to use when signing (assuming sign is TRUE) |
| recipients : | an array of recipient key ids and/or email addresses |
| istream : | cleartext input stream |
| ostream : | ciphertext output stream |
| err : | exception |
| Returns : | 0 on success or -1 on fail. |
int g_mime_cipher_decrypt (GMimeCipherContext *ctx, GMimeStream *istream, GMimeStream *ostream,GError **err);
Decrypts the ciphertext input stream and writes the resulting cleartext to the output stream.
| ctx : | Cipher Context |
| istream : | input/ciphertext stream |
| ostream : | output/cleartext stream |
| err : | exception |
| Returns : | 0 on success or -1 for fail. |
int g_mime_cipher_import_keys (GMimeCipherContext *ctx, GMimeStream *istream,GError **err);
Imports a stream of keys/certificates contained within istream into the key/certificate database controlled by ctx.
| ctx : | Cipher Context |
| istream : | input stream (containing keys) |
| err : | exception |
| Returns : | 0 on success or -1 on fail. |
int g_mime_cipher_export_keys (GMimeCipherContext *ctx,GPtrArray *keys, GMimeStream *ostream,GError **err);
Exports the keys/certificates in keys to the stream ostream from the key/certificate database controlled by ctx.
| ctx : | Cipher Context |
| keys : | an array of key ids |
| ostream : | output stream |
| err : | exception |
| Returns : | 0 on success or -1 on fail. |
void g_mime_cipher_validity_init (GMimeCipherValidity *validity);
Initializes the validity structure.
| validity : | validity structure |
GMimeCipherValidity* g_mime_cipher_validity_new (void);
Creates a new validity structure.
| Returns : | a new validity structure. |
void g_mime_cipher_validity_clear (GMimeCipherValidity *validity);
Clears the contents of the validity structure.
| validity : | validity structure |
void g_mime_cipher_validity_free (GMimeCipherValidity *validity);
Frees the memory used by validity back to the system.
| validity : | validity structure |
gboolean g_mime_cipher_validity_get_valid (GMimeCipherValidity *validity);
Gets the validity of the validity structure validity.
| validity : | validity structure |
| Returns : | TRUE if validity is valid or FALSE otherwise. |
void g_mime_cipher_validity_set_valid
(GMimeCipherValidity *validity,
gboolean valid);Sets the validness on the validity structure.
| validity : | validity structure |
| valid : | TRUE if valid else FALSE |
const char* g_mime_cipher_validity_get_description
(GMimeCipherValidity *validity);Gets the description set on the validity structure validity.
| validity : | validity structure |
| Returns : | any description set on the validity structure. |
void g_mime_cipher_validity_set_description
(GMimeCipherValidity *validity,
const char *description);Sets the description on the validity structure.
| validity : | validity structure |
| description : | validity description |
| <<< gmime-iconv-utils | gmime-gpg-context >>> |