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__
16 * struct openpgp_packet - Stores an OpenPGP packet.
17 * @tag: The packet tag (ie type).
18 * @newformat: Indicates if this is a new format packet.
19 * @length: The length of the packet.
20 * @data: The actual packet
22 * This structure holds any form of OpenPGP packet with minimum common
23 * details decoded out.
25 struct openpgp_packet {
33 * struct openpgp_packet_list - A linked list of OpenPGP packets.
34 * @packet: The actual packet structure.
35 * @next: A pointer to the next packet in the list.
37 * This structure is used to hold a linked list of packets, for example
38 * all the signatures of a public key's UID.
40 struct openpgp_packet_list {
41 struct openpgp_packet *packet;
42 struct openpgp_packet_list *next;
46 * struct openpgp_signedpacket_list - A packet with signatures.
47 * @uid: The OpenPGP packet that's signed.
48 * @sigs: A list of sigs for the packet.
49 * @next: A pointer to the next packet with signatures.
51 * This structure holds an OpenPGP packet along with signatures that are
52 * over this packet. It also links to the next signed packet. It's usually
53 * used to hold a UID or subkey with their associated signatures.
55 struct openpgp_signedpacket_list {
56 struct openpgp_packet *packet;
57 struct openpgp_packet_list *sigs;
58 struct openpgp_packet_list *last_sig;
59 struct openpgp_signedpacket_list *next;
63 * struct openpgp_publickey - An OpenPGP public key complete with sigs.
64 * @publickey: The OpenPGP packet for the public key.
65 * @revocation: The OpenPGP packet for the revocation [optional]
66 * @uids: The list of UIDs with signatures for this key.
67 * @subkeys: The list of subkeys with signatures for this key.
68 * @next: The next public key.
70 struct openpgp_publickey {
71 struct openpgp_packet *publickey;
72 struct openpgp_packet_list *revocations;
73 struct openpgp_packet_list *last_revocation;
74 struct openpgp_signedpacket_list *uids;
75 struct openpgp_signedpacket_list *last_uid;
76 struct openpgp_signedpacket_list *subkeys;
77 struct openpgp_signedpacket_list *last_subkey;
78 struct openpgp_publickey *next;
81 #endif /* __KEYSTRUCTS_H__ */