2 * keystructs.h - Structures for OpenPGP keys
4 * Jonathan McDowell <noodles@earth.li>
6 * Copyright 2002 Project Purple
9 #ifndef __KEYSTRUCTS_H__
10 #define __KEYSTRUCTS_H__
19 * struct openpgp_packet - Stores an OpenPGP packet.
20 * @tag: The packet tag (ie type).
21 * @newformat: Indicates if this is a new format packet.
22 * @length: The length of the packet.
23 * @data: The actual packet
25 * This structure holds any form of OpenPGP packet with minimum common
26 * details decoded out.
28 struct openpgp_packet {
36 * struct openpgp_packet_list - A linked list of OpenPGP packets.
37 * @packet: The actual packet structure.
38 * @next: A pointer to the next packet in the list.
40 * This structure is used to hold a linked list of packets, for example
41 * all the signatures of a public key's UID.
43 struct openpgp_packet_list {
44 struct openpgp_packet *packet;
45 struct openpgp_packet_list *next;
49 * struct openpgp_signedpacket_list - A packet with signatures.
50 * @uid: The OpenPGP packet that's signed.
51 * @sigs: A list of sigs for the packet.
52 * @next: A pointer to the next packet with signatures.
54 * This structure holds an OpenPGP packet along with signatures that are
55 * over this packet. It also links to the next signed packet. It's usually
56 * used to hold a UID or subkey with their associated signatures.
58 struct openpgp_signedpacket_list {
59 struct openpgp_packet *packet;
60 struct openpgp_packet_list *sigs;
61 struct openpgp_packet_list *last_sig;
62 struct openpgp_signedpacket_list *next;
66 * struct openpgp_publickey - An OpenPGP public key complete with sigs.
67 * @publickey: The OpenPGP packet for the public key.
68 * @revoked: True if the key is revoked.
69 * @sigs: Any signatures directly on the publickey packet.
70 * @uids: The list of UIDs with signatures for this key.
71 * @subkeys: The list of subkeys with signatures for this key.
72 * @next: The next public key.
74 struct openpgp_publickey {
75 struct openpgp_packet *publickey;
77 struct openpgp_packet_list *sigs;
78 struct openpgp_packet_list *last_sig;
79 struct openpgp_signedpacket_list *uids;
80 struct openpgp_signedpacket_list *last_uid;
81 struct openpgp_signedpacket_list *subkeys;
82 struct openpgp_signedpacket_list *last_subkey;
83 struct openpgp_publickey *next;
87 * struct stats_key - holds key details suitable for doing stats on.
89 * @colour: Used for marking during DFS/BFS.
90 * @parent: The key that lead us to this one for DFS/BFS.
91 * @sigs: A linked list of the signatures on this key.
92 * @gotsigs: A bool indicating if we've initialized the sigs element yet.
93 * @disabled: If we shouldn't consider the key in calculations.
94 * @revoked: If the key is revoked (and shouldn't be considered).
108 * struct skshash - holds an SKS key hash (md5 over sorted packet list)
109 * @hash: The 128 bit MD5 hash of the sorted packet list from the key
115 #endif /* __KEYSTRUCTS_H__ */