Only seed database for Debian install if we're using default config
[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 <inttypes.h>
13 #include <time.h>
14 #include "keystructs.h"
15 #include "ll.h"
16
17 /**
18  *      keysigs - Return the sigs on a given OpenPGP signature packet list.
19  *      @curll: The current linked list. Can be NULL to create a new list.
20  *      @sigs: The signature list we want the sigs on.
21  *
22  *      Returns a linked list of stats_key elements containing the sigs for the
23  *      supplied OpenPGP signature packet list.
24  */
25 struct ll *keysigs(struct ll *curll,
26                 struct openpgp_packet_list *sigs);
27
28 /**
29  *      sig_info - Get info on a given OpenPGP signature packet
30  *      @packet: The signature packet
31  *      @keyid: A pointer for where to return the signature keyid
32  *      @creation: A pointer for where to return the signature creation time
33  *
34  *      Gets any info about a signature packet; parses the subpackets for a v4
35  *      key or pulls the data directly from v2/3. NULL can be passed for any
36  *      values which aren't cared about.
37  */
38 void sig_info(struct openpgp_packet *packet, uint64_t *keyid, time_t *creation);
39
40 /**
41  *      sig_keyid - Return the keyid for a given OpenPGP signature packet.
42  *      @packet: The signature packet.
43  *
44  *      Returns the keyid for the supplied signature packet.
45  */
46 uint64_t sig_keyid(struct openpgp_packet *packet);
47
48 /**
49  *      keyuids - Takes a key and returns an array of its UIDs
50  *      @key: The key to get the uids of.
51  *      @primary: A pointer to store the primary UID in.
52  *
53  *      keyuids takes a public key structure and builds an array of the UIDs 
54  *      on the key. It also attempts to work out the primary UID and returns a
55  *      separate pointer to that particular element of the array.
56  */
57 char **keyuids(struct openpgp_publickey *key, char **primary);
58
59 /**
60  *      keysubkeys - Takes a key and returns an array of its subkey keyids.
61  *      @key: The key to get the subkeys of.
62  *
63  *      keysubkeys takes a public key structure and returns an array of the
64  *      subkey keyids for that key.
65  */
66 uint64_t *keysubkeys(struct openpgp_publickey *key);
67
68 #endif