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