mutt stable branch with some hacks
1/*
2 * Copyright (C) 1996-1997 Michael R. Elkins <me@mutt.org>
3 * Copyright (C) 1999-2002 Thomas Roessler <roessler@does-not-exist.org>
4 *
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.
9 *
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.
14 *
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#ifdef CRYPT_BACKEND_CLASSIC_PGP
21
22#include "mutt_crypt.h"
23
24
25typedef struct pgp_signature
26{
27 struct pgp_signature *next;
28 unsigned char sigtype;
29 unsigned long sid1;
30 unsigned long sid2;
31}
32pgp_sig_t;
33
34struct pgp_keyinfo
35{
36 char *keyid;
37 char *fingerprint;
38 struct pgp_uid *address;
39 int flags;
40 short keylen;
41 time_t gen_time;
42 int numalg;
43 const char *algorithm;
44 struct pgp_keyinfo *parent;
45 struct pgp_signature *sigs;
46 struct pgp_keyinfo *next;
47};
48/* Note, that pgp_key_t is now pointer and declared in crypt.h */
49
50typedef struct pgp_uid
51{
52 char *addr;
53 short trust;
54 int flags;
55 struct pgp_keyinfo *parent;
56 struct pgp_uid *next;
57 struct pgp_signature *sigs;
58}
59pgp_uid_t;
60
61enum pgp_version
62{
63 PGP_V2,
64 PGP_V3,
65 PGP_GPG,
66 PGP_UNKNOWN
67};
68
69/* prototypes */
70
71const char *pgp_pkalgbytype (unsigned char);
72
73pgp_key_t pgp_remove_key (pgp_key_t *, pgp_key_t );
74pgp_uid_t *pgp_copy_uids (pgp_uid_t *, pgp_key_t );
75
76short pgp_canencrypt (unsigned char);
77short pgp_cansign (unsigned char);
78short pgp_get_abilities (unsigned char);
79
80void pgp_free_key (pgp_key_t *kpp);
81
82#define pgp_new_keyinfo() safe_calloc (sizeof *((pgp_key_t)0), 1)
83
84#endif /* CRYPT_BACKEND_CLASSIC_PGP */