aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-pgp-mime.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-06-22 03:11:57 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-06-22 03:11:57 +0800
commitea6569368591c16ec4ef6398016a7d33579a793d (patch)
treef00390fc8b6602aee81971fcd58fe98bbb9f45d5 /camel/camel-pgp-mime.c
parent9534ce2e95c2d9886c4cc1e3fdd9e416629422ce (diff)
downloadgsoc2013-evolution-ea6569368591c16ec4ef6398016a7d33579a793d.tar
gsoc2013-evolution-ea6569368591c16ec4ef6398016a7d33579a793d.tar.gz
gsoc2013-evolution-ea6569368591c16ec4ef6398016a7d33579a793d.tar.bz2
gsoc2013-evolution-ea6569368591c16ec4ef6398016a7d33579a793d.tar.lz
gsoc2013-evolution-ea6569368591c16ec4ef6398016a7d33579a793d.tar.xz
gsoc2013-evolution-ea6569368591c16ec4ef6398016a7d33579a793d.tar.zst
gsoc2013-evolution-ea6569368591c16ec4ef6398016a7d33579a793d.zip
New source files implementing the CamelCipherContext class for gnupg.
2002-06-21 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.[c,h]: New source files implementing the CamelCipherContext class for gnupg. * camel-pgp-context.c (camel_pgp_context_new): Return a CamelCipherContext. * camel-pgp-mime.c (camel_pgp_mime_part_decrypt): Take a CamelCipherContext argument rather than a CamelPgpContext since we now have a CamelGpgContext also. (camel_pgp_mime_part_encrypt): Same. (camel_pgp_mime_part_verify): Same. (camel_pgp_mime_part_sign): Same. svn path=/trunk/; revision=17251
Diffstat (limited to 'camel/camel-pgp-mime.c')
-rw-r--r--camel/camel-pgp-mime.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/camel/camel-pgp-mime.c b/camel/camel-pgp-mime.c
index b0e3ab379e..c297194bd3 100644
--- a/camel/camel-pgp-mime.c
+++ b/camel/camel-pgp-mime.c
@@ -240,7 +240,7 @@ pgp_mime_part_sign_prepare_part (CamelMimePart *mime_part, GSList **encodings)
/**
* camel_pgp_mime_part_sign:
- * @context: PGP Context
+ * @cipher: PGP Cipher Context
* @mime_part: a MIME part that will be replaced by a pgp signed part
* @userid: userid to sign with
* @hash: one of CAMEL_PGP_HASH_TYPE_MD5 or CAMEL_PGP_HASH_TYPE_SHA1
@@ -251,7 +251,7 @@ pgp_mime_part_sign_prepare_part (CamelMimePart *mime_part, GSList **encodings)
* @ex will be set and #part will remain untouched.
**/
void
-camel_pgp_mime_part_sign (CamelPgpContext *context, CamelMimePart **mime_part, const char *userid,
+camel_pgp_mime_part_sign (CamelCipherContext *cipher, CamelMimePart **mime_part, const char *userid,
CamelCipherHash hash, CamelException *ex)
{
CamelMimePart *part, *signed_part;
@@ -327,7 +327,7 @@ camel_pgp_mime_part_sign (CamelPgpContext *context, CamelMimePart **mime_part, c
}
/* get the signature */
- if (camel_pgp_sign (context, userid, hash, stream, sigstream, ex) == -1) {
+ if (camel_cipher_sign (cipher, userid, hash, stream, sigstream, ex) == -1) {
GSList *list;
camel_object_unref (CAMEL_OBJECT (stream));
@@ -381,14 +381,14 @@ camel_pgp_mime_part_sign (CamelPgpContext *context, CamelMimePart **mime_part, c
/**
* camel_pgp_mime_part_verify:
- * @context: PGP Context
+ * @cipher: PGP Cipher Context
* @mime_part: a multipart/signed MIME Part
* @ex: exception
*
* Returns a CamelCipherValidity on success or NULL on fail.
**/
CamelCipherValidity *
-camel_pgp_mime_part_verify (CamelPgpContext *context, CamelMimePart *mime_part, CamelException *ex)
+camel_pgp_mime_part_verify (CamelCipherContext *cipher, CamelMimePart *mime_part, CamelException *ex)
{
CamelDataWrapper *wrapper;
CamelMultipart *multipart;
@@ -437,7 +437,7 @@ camel_pgp_mime_part_verify (CamelPgpContext *context, CamelMimePart *mime_part,
camel_stream_reset (sigstream);
/* verify */
- valid = camel_pgp_verify (context, stream, sigstream, ex);
+ valid = camel_cipher_verify (cipher, CAMEL_CIPHER_HASH_DEFAULT, stream, sigstream, ex);
d(printf ("attempted to verify data:\n----- BEGIN SIGNED PART -----\n%.*s----- END SIGNED PART -----\n",
CAMEL_STREAM_MEM (stream)->buffer->len, CAMEL_STREAM_MEM (stream)->buffer->data));
@@ -451,7 +451,7 @@ camel_pgp_mime_part_verify (CamelPgpContext *context, CamelMimePart *mime_part,
/**
* camel_pgp_mime_part_encrypt:
- * @context: PGP Context
+ * @cipher: PGP Cipher Context
* @mime_part: a MIME part that will be replaced by a pgp encrypted part
* @recipients: list of recipient PGP Key IDs
* @ex: exception which will be set if there are any errors.
@@ -461,7 +461,7 @@ camel_pgp_mime_part_verify (CamelPgpContext *context, CamelMimePart *mime_part,
* #ex will be set and #part will remain untouched.
**/
void
-camel_pgp_mime_part_encrypt (CamelPgpContext *context, CamelMimePart **mime_part,
+camel_pgp_mime_part_encrypt (CamelCipherContext *cipher, CamelMimePart **mime_part,
GPtrArray *recipients, CamelException *ex)
{
CamelMultipart *multipart;
@@ -490,7 +490,7 @@ camel_pgp_mime_part_encrypt (CamelPgpContext *context, CamelMimePart **mime_part
/* pgp encrypt */
ciphertext = camel_stream_mem_new ();
- if (camel_pgp_encrypt (context, FALSE, NULL, recipients, stream, ciphertext, ex) == -1) {
+ if (camel_cipher_encrypt (cipher, FALSE, NULL, recipients, stream, ciphertext, ex) == -1) {
camel_object_unref (CAMEL_OBJECT (stream));
camel_object_unref (CAMEL_OBJECT (ciphertext));
return;
@@ -540,14 +540,14 @@ camel_pgp_mime_part_encrypt (CamelPgpContext *context, CamelMimePart **mime_part
/**
* camel_pgp_mime_part_decrypt:
- * @context: PGP Context
+ * @cipher: PGP Cipher Context
* @mime_part: a multipart/encrypted MIME Part
* @ex: exception
*
* Returns the decrypted MIME Part on success or NULL on fail.
**/
CamelMimePart *
-camel_pgp_mime_part_decrypt (CamelPgpContext *context, CamelMimePart *mime_part, CamelException *ex)
+camel_pgp_mime_part_decrypt (CamelCipherContext *cipher, CamelMimePart *mime_part, CamelException *ex)
{
CamelDataWrapper *wrapper;
CamelMultipart *multipart;
@@ -580,7 +580,7 @@ camel_pgp_mime_part_decrypt (CamelPgpContext *context, CamelMimePart *mime_part,
/* get the cleartext */
stream = camel_stream_mem_new ();
- if (camel_pgp_decrypt (context, ciphertext, stream, ex) == -1) {
+ if (camel_cipher_decrypt (cipher, ciphertext, stream, ex) == -1) {
camel_object_unref (CAMEL_OBJECT (ciphertext));
camel_object_unref (CAMEL_OBJECT (stream));
return NULL;