]>
git.sthu.org Git - pgp-tools.git/blob - keyanalyze/pgpring/pgplib.h
2 * Copyright (C) 1996,1997 Michael R. Elkins <me@cs.hmc.edu>
3 * Copyright (C) 1999-2000 Thomas Roessler <roessler@guug.de>
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.
22 #define PGPENCRYPT (1 << 0)
23 #define PGPSIGN (1 << 1)
24 #define PGPKEY (1 << 2)
25 #define PGPGOODSIGN (1 << 3)
27 #define KEYFLAG_CANSIGN (1 << 0)
28 #define KEYFLAG_CANENCRYPT (1 << 1)
29 #define KEYFLAG_SECRET (1 << 7)
30 #define KEYFLAG_EXPIRED (1 << 8)
31 #define KEYFLAG_REVOKED (1 << 9)
32 #define KEYFLAG_DISABLED (1 << 10)
33 #define KEYFLAG_SUBKEY (1 << 11)
34 #define KEYFLAG_CRITICAL (1 << 12)
35 #define KEYFLAG_PREFER_ENCRYPTION (1 << 13)
36 #define KEYFLAG_PREFER_SIGNING (1 << 14)
38 #define KEYFLAG_CANTUSE (KEYFLAG_DISABLED|KEYFLAG_REVOKED|KEYFLAG_EXPIRED)
39 #define KEYFLAG_RESTRICTIONS (KEYFLAG_CANTUSE|KEYFLAG_CRITICAL)
41 #define KEYFLAG_ABILITIES (KEYFLAG_CANSIGN|KEYFLAG_CANENCRYPT|KEYFLAG_PREFER_ENCRYPTION|KEYFLAG_PREFER_SIGNING)
43 typedef struct pgp_signature
45 struct pgp_signature
*next
;
46 unsigned char sigtype
;
52 typedef struct pgp_keyinfo
55 struct pgp_uid
*address
;
60 const char *algorithm
;
61 struct pgp_keyinfo
*parent
;
62 struct pgp_signature
*sigs
;
63 struct pgp_keyinfo
*next
;
67 typedef struct pgp_uid
72 struct pgp_keyinfo
*parent
;
74 struct pgp_signature
*sigs
;
92 typedef enum pgp_ring pgp_ring_t
;
96 const char *pgp_pkalgbytype (unsigned char);
98 pgp_key_t
*pgp_remove_key (pgp_key_t
**, pgp_key_t
*);
99 pgp_uid_t
*pgp_copy_uids (pgp_uid_t
*, pgp_key_t
*);
101 short pgp_canencrypt (unsigned char);
102 short pgp_cansign (unsigned char);
103 short pgp_get_abilities (unsigned char);
105 void pgp_free_key (pgp_key_t
**kpp
);
107 #define pgp_new_keyinfo() safe_calloc (sizeof (pgp_key_t), 1)
109 #endif /* HAVE_PGP */