diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-04-13 05:18:40 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-04-13 05:18:40 +0800 |
commit | 0417c81c051f9180a38a6ac0054646bf5877e8b0 (patch) | |
tree | 7430db8059d71d5111f77a463a1d31d0b9b16dfe /camel/camel-pgp-context.h | |
parent | 0111c4d86fb5c33a61c29868443c746c8c4cf2c5 (diff) | |
download | gsoc2013-evolution-0417c81c051f9180a38a6ac0054646bf5877e8b0.tar gsoc2013-evolution-0417c81c051f9180a38a6ac0054646bf5877e8b0.tar.gz gsoc2013-evolution-0417c81c051f9180a38a6ac0054646bf5877e8b0.tar.bz2 gsoc2013-evolution-0417c81c051f9180a38a6ac0054646bf5877e8b0.tar.lz gsoc2013-evolution-0417c81c051f9180a38a6ac0054646bf5877e8b0.tar.xz gsoc2013-evolution-0417c81c051f9180a38a6ac0054646bf5877e8b0.tar.zst gsoc2013-evolution-0417c81c051f9180a38a6ac0054646bf5877e8b0.zip |
Updated to reflect the few changes made to the CamelPgpContext class.
2001-04-12 Jeffrey Stedfast <fejj@ximian.com>
* camel-pgp-mime.c: Updated to reflect the few changes made to the
CamelPgpContext class.
* camel-pgp-context.c: Updated to subclass of CamelCipherContext.
* camel-cipher-context.[c,h]: New base class for
CamelPgpContext. Also contains the replacement for
CamelPgpValidity, CamelCipherValidity.
svn path=/trunk/; revision=9283
Diffstat (limited to 'camel/camel-pgp-context.h')
-rw-r--r-- | camel/camel-pgp-context.h | 56 |
1 files changed, 8 insertions, 48 deletions
diff --git a/camel/camel-pgp-context.h b/camel/camel-pgp-context.h index 239d15bf3e..0f4f705d64 100644 --- a/camel/camel-pgp-context.h +++ b/camel/camel-pgp-context.h @@ -20,22 +20,13 @@ * */ -/* Once I figure out a nice API for S/MIME, it may be ideal to make a - * new klass `CamelSecurityContext' or somesuch and have - * CamelPgpContext (and the future CamelSMIMEContext) subclass it. - * - * The virtual functions could be sign, (clearsign maybe?,) verify, encrypt, and decrypt - * - * I could also make CamelPgpValidity more generic, maybe call it - * CamelSignatureValidity or somesuch. - */ - #ifndef CAMEL_PGP_CONTEXT_H #define CAMEL_PGP_CONTEXT_H #include <camel/camel-session.h> #include <camel/camel-stream.h> #include <camel/camel-exception.h> +#include <camel/camel-cipher-context.h> #ifdef __cplusplus extern "C" { @@ -55,63 +46,32 @@ typedef enum { CAMEL_PGP_TYPE_GPG } CamelPgpType; -typedef enum { - CAMEL_PGP_HASH_TYPE_DEFAULT, - CAMEL_PGP_HASH_TYPE_MD5, - CAMEL_PGP_HASH_TYPE_SHA1 -} CamelPgpHashType; - typedef struct _CamelPgpContext { - CamelObject parent_object; + CamelCipherContext parent_object; struct _CamelPgpContextPrivate *priv; } CamelPgpContext; typedef struct _CamelPgpContextClass { - CamelObjectClass parent_class; + CamelCipherContextClass parent_class; } CamelPgpContextClass; -typedef struct _CamelPgpValidity CamelPgpValidity; - CamelType camel_pgp_context_get_type (void); CamelPgpContext *camel_pgp_context_new (CamelSession *session, CamelPgpType type, const char *path); /* PGP routines */ -int camel_pgp_sign (CamelPgpContext *context, const char *userid, CamelPgpHashType hash, - CamelStream *istream, CamelStream *ostream, CamelException *ex); - -int camel_pgp_clearsign (CamelPgpContext *context, const char *userid, CamelPgpHashType hash, - CamelStream *istream, CamelStream *ostream, CamelException *ex); - -CamelPgpValidity *camel_pgp_verify (CamelPgpContext *context, CamelStream *istream, CamelStream *sigstream, - CamelException *ex); - -int camel_pgp_encrypt (CamelPgpContext *context, gboolean sign, const char *userid, - GPtrArray *recipients, CamelStream *istream, CamelStream *ostream, - CamelException *ex); - -int camel_pgp_decrypt (CamelPgpContext *context, CamelStream *istream, CamelStream *ostream, - CamelException *ex); - -/* CamelPgpValidity utility functions */ -CamelPgpValidity *camel_pgp_validity_new (void); - -void camel_pgp_validity_init (CamelPgpValidity *validity); - -gboolean camel_pgp_validity_get_valid (CamelPgpValidity *validity); - -void camel_pgp_validity_set_valid (CamelPgpValidity *validity, gboolean valid); +#define camel_pgp_sign(c, u, h, i, o, e) camel_cipher_sign (CAMEL_CIPHER_CONTEXT (c), u, h, i, o, e) -gchar *camel_pgp_validity_get_description (CamelPgpValidity *validity); +#define camel_pgp_clearsign(c, u, h, i, o, e) camel_cipher_clearsign (CAMEL_CIPHER_CONTEXT (c), u, h, i, o, e) -void camel_pgp_validity_set_description (CamelPgpValidity *validity, const gchar *description); +#define camel_pgp_verify(c, i, s, e) camel_cipher_verify (CAMEL_CIPHER_CONTEXT (c), i, s, e) -void camel_pgp_validity_clear (CamelPgpValidity *validity); +#define camel_pgp_encrypt(c, s, u, r, i, o, e) camel_cipher_encrypt (CAMEL_CIPHER_CONTEXT (c), s, u, r, i, o, e) -void camel_pgp_validity_free (CamelPgpValidity *validity); +#define camel_pgp_decrypt(c, i, o, e) camel_cipher_decrypt (CAMEL_CIPHER_CONTEXT (c), i, o, e) #ifdef __cplusplus } |