2 * keystructs.h - Structures for OpenPGP keys
4 * Copyright 2002 Jonathan McDowell <noodles@earth.li>
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef __KEYSTRUCTS_H__
21 #define __KEYSTRUCTS_H__
30 * struct openpgp_packet - Stores an OpenPGP packet.
31 * @tag: The packet tag (ie type).
32 * @newformat: Indicates if this is a new format packet.
33 * @length: The length of the packet.
34 * @data: The actual packet
36 * This structure holds any form of OpenPGP packet with minimum common
37 * details decoded out.
39 struct openpgp_packet {
47 * struct openpgp_packet_list - A linked list of OpenPGP packets.
48 * @packet: The actual packet structure.
49 * @next: A pointer to the next packet in the list.
51 * This structure is used to hold a linked list of packets, for example
52 * all the signatures of a public key's UID.
54 struct openpgp_packet_list {
55 struct openpgp_packet *packet;
56 struct openpgp_packet_list *next;
60 * struct openpgp_signedpacket_list - A packet with signatures.
61 * @uid: The OpenPGP packet that's signed.
62 * @sigs: A list of sigs for the packet.
63 * @next: A pointer to the next packet with signatures.
65 * This structure holds an OpenPGP packet along with signatures that are
66 * over this packet. It also links to the next signed packet. It's usually
67 * used to hold a UID or subkey with their associated signatures.
69 struct openpgp_signedpacket_list {
70 struct openpgp_packet *packet;
71 struct openpgp_packet_list *sigs;
72 struct openpgp_packet_list *last_sig;
73 struct openpgp_signedpacket_list *next;
77 * struct openpgp_publickey - An OpenPGP public key complete with sigs.
78 * @publickey: The OpenPGP packet for the public key.
79 * @revoked: True if the key is revoked.
80 * @sigs: Any signatures directly on the publickey packet.
81 * @uids: The list of UIDs with signatures for this key.
82 * @subkeys: The list of subkeys with signatures for this key.
83 * @next: The next public key.
85 struct openpgp_publickey {
86 struct openpgp_packet *publickey;
88 struct openpgp_packet_list *sigs;
89 struct openpgp_packet_list *last_sig;
90 struct openpgp_signedpacket_list *uids;
91 struct openpgp_signedpacket_list *last_uid;
92 struct openpgp_signedpacket_list *subkeys;
93 struct openpgp_signedpacket_list *last_subkey;
94 struct openpgp_publickey *next;
98 * struct stats_key - holds key details suitable for doing stats on.
100 * @colour: Used for marking during DFS/BFS.
101 * @parent: The key that lead us to this one for DFS/BFS.
102 * @sigs: A linked list of the signatures on this key.
103 * @gotsigs: A bool indicating if we've initialized the sigs element yet.
104 * @disabled: If we shouldn't consider the key in calculations.
105 * @revoked: If the key is revoked (and shouldn't be considered).
119 * struct skshash - holds an SKS key hash (md5 over sorted packet list)
120 * @hash: The 128 bit MD5 hash of the sorted packet list from the key
126 #endif /* __KEYSTRUCTS_H__ */