cscvs to tla changeset 52
[onak.git] / keyid.h
1 /*
2  * keyid.h - Routines to calculate key IDs.
3  *
4  * Jonathan McDowell <noodles@earth.li>
5  *
6  * Copyright 2002 Project Purple
7  */
8
9 #ifndef __KEYID_H__
10 #define __KEYID_H__
11
12 // #include <stdint.h>
13 #include <inttypes.h>
14
15 #include "keystructs.h"
16
17 /**
18  *      get_keyid - Given a public key returns the keyid.
19  *      @publickey: The key to calculate the id for.
20  *
21  *      This function returns the key id for a given public key.
22  */
23 uint64_t get_keyid(struct openpgp_publickey *publickey);
24
25 /**
26  *      get_fingerprint - Given a public key returns the fingerprint.
27  *      @publickey: The key to calculate the id for.
28  *      @fingerprint: The fingerprint (must be at least 20 bytes of space). 
29  *      @len: The length of the returned fingerprint.
30  *
31  *      This function returns the fingerprint for a given public key. As Type 3
32  *      fingerprints are 16 bytes and Type 4 are 20 the len field indicates
33  *      which we've returned.
34  */
35 unsigned char *get_fingerprint(struct openpgp_packet *packet,
36         unsigned char *fingerprint,
37         size_t *len);
38
39 /**
40  *      get_packetid - Given a PGP packet returns the keyid.
41  *      @packet: The packet to calculate the id for.
42  *
43  *      This function returns the key id for a given PGP packet.
44  */
45 uint64_t get_packetid(struct openpgp_packet *packet);
46
47 #endif /* __KEYID_H__ */