2 * Copyright (C) 1996,1997 Michael R. Elkins <me@mutt.org>
3 * Copyright (C) 1999-2000 Thomas Roessler <roessler@does-not-exist.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
20 #ifdef CRYPT_BACKEND_CLASSIC_PGP
22 #include "mutt_crypt.h"
25 typedef struct pgp_signature {
26 struct pgp_signature *next;
27 unsigned char sigtype;
34 struct pgp_uid *address;
39 const char *algorithm;
40 struct pgp_keyinfo *parent;
41 struct pgp_signature *sigs;
42 struct pgp_keyinfo *next;
44 short fp_len; /* length of fingerprint.
45 * 20 for sha-1, 16 for md5.
47 unsigned char fingerprint[20]; /* large enough to hold SHA-1 and RIPEMD160
48 hashes (20 bytes), MD5 hashes just use the
52 /* Note, that pgp_key_t is now pointer and declared in crypt.h */
54 typedef struct pgp_uid {
58 struct pgp_keyinfo *parent;
60 struct pgp_signature *sigs;
72 const char *pgp_pkalgbytype (unsigned char);
74 pgp_key_t pgp_remove_key (pgp_key_t *, pgp_key_t);
75 pgp_uid_t *pgp_copy_uids (pgp_uid_t *, pgp_key_t);
77 short pgp_canencrypt (unsigned char);
78 short pgp_cansign (unsigned char);
79 short pgp_get_abilities (unsigned char);
81 void pgp_free_key (pgp_key_t * kpp);
83 #define pgp_new_keyinfo() safe_calloc (sizeof *((pgp_key_t)0), 1)
85 #endif /* CRYPT_BACKEND_CLASSIC_PGP */