aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-cipher-context.h
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-11-01 08:45:05 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-11-01 08:45:05 +0800
commit8ae8cb35257f42c905c86eb424759fdfde97eb41 (patch)
treef4d109c4352dc18263b35b396164e1cedb98fcee /camel/camel-cipher-context.h
parentcfe440f26dada9764f9551771977e5fc76e8d692 (diff)
downloadgsoc2013-evolution-8ae8cb35257f42c905c86eb424759fdfde97eb41.tar.gz
gsoc2013-evolution-8ae8cb35257f42c905c86eb424759fdfde97eb41.tar.zst
gsoc2013-evolution-8ae8cb35257f42c905c86eb424759fdfde97eb41.zip
Set the virtual method pointers to the import/export methods.
2002-10-31 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (camel_gpg_context_class_init): Set the virtual method pointers to the import/export methods. (camel_gpg_context_init): Set the key_protocol string. (gpg_hash_to_id): Handle 2 more hash types. (gpg_id_to_hash): Same. (gpg_ctx_op_step): Slight fixes to support import/export. (gpg_ctx_parse_status): Fix to hack around the fact that importing keys doesn't write to stdout. (gpg_import_keys): Implemented. (gpg_export_keys): Implemented. * camel-cipher-context.c (camel_cipher_context_class_init): Hook up default virtual methods for import/export. (camel_cipher_import_keys): Implemented. (camel_cipher_export_keys): Implemented. svn path=/trunk/; revision=18475
Diffstat (limited to 'camel/camel-cipher-context.h')
-rw-r--r--camel/camel-cipher-context.h29
1 files changed, 22 insertions, 7 deletions
diff --git a/camel/camel-cipher-context.h b/camel/camel-cipher-context.h
index 296d7e5b39..45444c26a0 100644
--- a/camel/camel-cipher-context.h
+++ b/camel/camel-cipher-context.h
@@ -44,7 +44,9 @@ typedef enum {
CAMEL_CIPHER_HASH_MD2,
CAMEL_CIPHER_HASH_MD5,
CAMEL_CIPHER_HASH_SHA1,
- CAMEL_CIPHER_HASH_RIPEMD160
+ CAMEL_CIPHER_HASH_RIPEMD160,
+ CAMEL_CIPHER_HASH_TIGER192,
+ CAMEL_CIPHER_HASH_HAVAL5160
} CamelCipherHash;
typedef struct _CamelCipherContext {
@@ -57,12 +59,16 @@ typedef struct _CamelCipherContext {
/* these MUST be set by implementors */
const char *sign_protocol;
const char *encrypt_protocol;
+ const char *key_protocol;
} CamelCipherContext;
typedef struct _CamelCipherContextClass {
CamelObjectClass parent_class;
- int (*sign) (CamelCipherContext *ctx, const char *userid, CamelCipherHash hash,
+ CamelCipherHash (*id_to_hash)(CamelCipherContext *context, const char *id);
+ const char * (*hash_to_id)(CamelCipherContext *context, CamelCipherHash hash);
+
+ int (*sign) (CamelCipherContext *context, const char *userid, CamelCipherHash hash,
CamelStream *istream, CamelStream *ostream, CamelException *ex);
CamelCipherValidity * (*verify) (CamelCipherContext *context, CamelCipherHash hash,
@@ -76,9 +82,11 @@ typedef struct _CamelCipherContextClass {
int (*decrypt) (CamelCipherContext *context, CamelStream *istream, CamelStream *ostream,
CamelException *ex);
- CamelCipherHash (*id_to_hash)(CamelCipherContext *context, const char *id);
- const char * (*hash_to_id)(CamelCipherContext *context, CamelCipherHash hash);
+ int (*import_keys) (CamelCipherContext *context, CamelStream *istream,
+ CamelException *ex);
+ int (*export_keys) (CamelCipherContext *context, GPtrArray *keys,
+ CamelStream *ostream, CamelException *ex);
} CamelCipherContextClass;
CamelType camel_cipher_context_get_type (void);
@@ -87,6 +95,10 @@ CamelCipherContext *camel_cipher_context_new (CamelSession *session);
void camel_cipher_context_construct (CamelCipherContext *context, CamelSession *session);
+/* cipher context util routines */
+CamelCipherHash camel_cipher_id_to_hash (CamelCipherContext *context, const char *id);
+const char * camel_cipher_hash_to_id (CamelCipherContext *context, CamelCipherHash hash);
+
/* cipher routines */
int camel_cipher_sign (CamelCipherContext *context, const char *userid, CamelCipherHash hash,
CamelStream *istream, CamelStream *ostream, CamelException *ex);
@@ -102,9 +114,12 @@ int camel_cipher_encrypt (CamelCipherContext *context, gboolean
int camel_cipher_decrypt (CamelCipherContext *context, CamelStream *istream, CamelStream *ostream,
CamelException *ex);
-/* cipher context util routines */
-CamelCipherHash camel_cipher_id_to_hash (CamelCipherContext *context, const char *id);
-const char * camel_cipher_hash_to_id (CamelCipherContext *context, CamelCipherHash hash);
+/* key/certificate routines */
+int camel_cipher_import_keys (CamelCipherContext *context, CamelStream *istream,
+ CamelException *ex);
+
+int camel_cipher_export_keys (CamelCipherContext *context, GPtrArray *keys,
+ CamelStream *ostream, CamelException *ex);
/* CamelCipherValidity utility functions */
CamelCipherValidity *camel_cipher_validity_new (void);