diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2001-01-10 02:27:59 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-01-10 02:27:59 +0800 |
commit | 8265e5d841dba4d70b768475da20372d26f83998 (patch) | |
tree | d7fe24c3a0eb4d9e65841f4bac010e59cd23bfd7 /mail/openpgp-utils.h | |
parent | 2b1d1fdc36a85c3cd3b18cd1d24ef36e35d36504 (diff) | |
download | gsoc2013-evolution-8265e5d841dba4d70b768475da20372d26f83998.tar gsoc2013-evolution-8265e5d841dba4d70b768475da20372d26f83998.tar.gz gsoc2013-evolution-8265e5d841dba4d70b768475da20372d26f83998.tar.bz2 gsoc2013-evolution-8265e5d841dba4d70b768475da20372d26f83998.tar.lz gsoc2013-evolution-8265e5d841dba4d70b768475da20372d26f83998.tar.xz gsoc2013-evolution-8265e5d841dba4d70b768475da20372d26f83998.tar.zst gsoc2013-evolution-8265e5d841dba4d70b768475da20372d26f83998.zip |
Updated. (decode_pgp): Get rid of #ifdef PGP_PROGRAM's and handle
2001-01-09 Jeffrey Stedfast <fejj@helixcode.com>
* mail-format.c: Updated.
(decode_pgp): Get rid of #ifdef PGP_PROGRAM's and handle
appropriately.
(handle_multipart_signed): Same.
(handle_multipart_encrypted): Same.
* Makefile.am: Added openpgp-utils.[c,h] to the build.
* openpgp-utils.c: New source file containing all of the pgp
interface code.
* mail-crypto.c: Removed all of the openpgp funtions as they are
being moved to a new file.
(mail_crypto_is_rfc2015_signed): Renamed.
(mail_crypto_is_rfc2015_encrypted): Renamed.
svn path=/trunk/; revision=7320
Diffstat (limited to 'mail/openpgp-utils.h')
-rw-r--r-- | mail/openpgp-utils.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/mail/openpgp-utils.h b/mail/openpgp-utils.h new file mode 100644 index 0000000000..17c5e22ccf --- /dev/null +++ b/mail/openpgp-utils.h @@ -0,0 +1,74 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Authors: Jeffrey Stedfast <fejj@helixcode.com> + * + * Copyright 2000 Helix Code, Inc. (www.helixcode.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. + * + */ + + +#ifndef __OPENPGP_UTILS_H__ +#define __OPENPGP_UTILS_H__ + +#include <glib.h> +#include <camel/camel-exception.h> + +#ifdef __cplusplus +extern "C" { +#pragma } +#endif /* __cplusplus */ + +typedef enum { + PGP_TYPE_NONE, + PGP_TYPE_PGP2, + PGP_TYPE_PGP5, + PGP_TYPE_GPG +} PgpType; + +typedef enum { + PGP_HASH_TYPE_NONE, + PGP_HASH_TYPE_MD5, + PGP_HASH_TYPE_SHA1 +} PgpHashType; + +typedef gchar* (*PgpPasswdFunc) (const gchar *prompt, gpointer data); + +void openpgp_init (const gchar *path, PgpType type, PgpPasswdFunc callback, gpointer data); + +gboolean openpgp_detect (const gchar *text); + +gboolean openpgp_sign_detect (const gchar *text); + +gchar *openpgp_decrypt (const gchar *ciphertext, gint cipherlen, gint *outlen, CamelException *ex); + +gchar *openpgp_encrypt (const gchar *in, gint inlen, const GPtrArray *recipients, + gboolean sign, const gchar *userid, CamelException *ex); + +gchar *openpgp_clearsign (const gchar *plaintext, const gchar *userid, + PgpHashType hash, CamelException *ex); + +gchar *openpgp_sign (const gchar *in, gint inlen, const gchar *userid, + PgpHashType hash, CamelException *ex); + +gboolean openpgp_verify (const gchar *in, gint inlen, const gchar *sigin, + gint siglen, CamelException *ex); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __OPENPGP_UTILS_H__ */ |