Allow checking for signature times and use in merging
[onak.git] / decodekey.h
1 /*
2  * keyindex.h - Routines to list an OpenPGP key.
3  *
4  * Jonathan McDowell <noodles@earth.li>
5  *
6  * Copyright 2002 Project Purple
7  */
8
9 #ifndef __DECODEKEY_H__
10 #define __DECODEKEY_H__
11
12 #include "keystructs.h"
13 #include "ll.h"
14
15 /**
16  *      keysigs - Return the sigs on a given OpenPGP signature packet list.
17  *      @curll: The current linked list. Can be NULL to create a new list.
18  *      @sigs: The signature list we want the sigs on.
19  *
20  *      Returns a linked list of stats_key elements containing the sigs for the
21  *      supplied OpenPGP signature packet list.
22  */
23 struct ll *keysigs(struct ll *curll,
24                 struct openpgp_packet_list *sigs);
25
26 /**
27  *      sig_info - Get info on a given OpenPGP signature packet
28  *      @packet: The signature packet
29  *      @keyid: A pointer for where to return the signature keyid
30  *      @creation: A pointer for where to return the signature creation time
31  *
32  *      Gets any info about a signature packet; parses the subpackets for a v4
33  *      key or pulls the data directly from v2/3. NULL can be passed for any
34  *      values which aren't cared about.
35  */
36 void sig_info(struct openpgp_packet *packet, uint64_t *keyid, time_t *creation);
37
38 /**
39  *      sig_keyid - Return the keyid for a given OpenPGP signature packet.
40  *      @packet: The signature packet.
41  *
42  *      Returns the keyid for the supplied signature packet.
43  */
44 uint64_t sig_keyid(struct openpgp_packet *packet);
45
46 /**
47  *      keyuids - Takes a key and returns an array of its UIDs
48  *      @key: The key to get the uids of.
49  *      @primary: A pointer to store the primary UID in.
50  *
51  *      keyuids takes a public key structure and builds an array of the UIDs 
52  *      on the key. It also attempts to work out the primary UID and returns a
53  *      separate pointer to that particular element of the array.
54  */
55 char **keyuids(struct openpgp_publickey *key, char **primary);
56
57 /**
58  *      keysubkeys - Takes a key and returns an array of its subkey keyids.
59  *      @key: The key to get the subkeys of.
60  *
61  *      keysubkeys takes a public key structure and returns an array of the
62  *      subkey keyids for that key.
63  */
64 uint64_t *keysubkeys(struct openpgp_publickey *key);
65
66 #endif