2 * keystructs.h - Structures for OpenPGP keys
4 * Jonathan McDowell <noodles@earth.li>
6 * Copyright 2002 Project Purple
8 * $Id: keystructs.h,v 1.7 2003/06/08 21:11:01 noodles Exp $
11 #ifndef __KEYSTRUCTS_H__
12 #define __KEYSTRUCTS_H__
21 * struct openpgp_packet - Stores an OpenPGP packet.
22 * @tag: The packet tag (ie type).
23 * @newformat: Indicates if this is a new format packet.
24 * @length: The length of the packet.
25 * @data: The actual packet
27 * This structure holds any form of OpenPGP packet with minimum common
28 * details decoded out.
30 struct openpgp_packet {
38 * struct openpgp_packet_list - A linked list of OpenPGP packets.
39 * @packet: The actual packet structure.
40 * @next: A pointer to the next packet in the list.
42 * This structure is used to hold a linked list of packets, for example
43 * all the signatures of a public key's UID.
45 struct openpgp_packet_list {
46 struct openpgp_packet *packet;
47 struct openpgp_packet_list *next;
51 * struct openpgp_signedpacket_list - A packet with signatures.
52 * @uid: The OpenPGP packet that's signed.
53 * @sigs: A list of sigs for the packet.
54 * @next: A pointer to the next packet with signatures.
56 * This structure holds an OpenPGP packet along with signatures that are
57 * over this packet. It also links to the next signed packet. It's usually
58 * used to hold a UID or subkey with their associated signatures.
60 struct openpgp_signedpacket_list {
61 struct openpgp_packet *packet;
62 struct openpgp_packet_list *sigs;
63 struct openpgp_packet_list *last_sig;
64 struct openpgp_signedpacket_list *next;
68 * struct openpgp_publickey - An OpenPGP public key complete with sigs.
69 * @publickey: The OpenPGP packet for the public key.
70 * @revocation: The OpenPGP packet for the revocation [optional]
71 * @uids: The list of UIDs with signatures for this key.
72 * @subkeys: The list of subkeys with signatures for this key.
73 * @next: The next public key.
75 struct openpgp_publickey {
76 struct openpgp_packet *publickey;
77 struct openpgp_packet_list *revocations;
78 struct openpgp_packet_list *last_revocation;
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).
107 #endif /* __KEYSTRUCTS_H__ */