cscvs to tla changeset 77
[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  * $Id: keyid.h,v 1.4 2003/06/04 20:57:09 noodles Exp $
9  */
10
11 #ifndef __KEYID_H__
12 #define __KEYID_H__
13
14 // #include <stdint.h>
15 #include <inttypes.h>
16
17 #include "keystructs.h"
18
19 /**
20  *      get_keyid - Given a public key returns the keyid.
21  *      @publickey: The key to calculate the id for.
22  *
23  *      This function returns the key id for a given public key.
24  */
25 uint64_t get_keyid(struct openpgp_publickey *publickey);
26
27 /**
28  *      get_fingerprint - Given a public key returns the fingerprint.
29  *      @publickey: The key to calculate the id for.
30  *      @fingerprint: The fingerprint (must be at least 20 bytes of space). 
31  *      @len: The length of the returned fingerprint.
32  *
33  *      This function returns the fingerprint for a given public key. As Type 3
34  *      fingerprints are 16 bytes and Type 4 are 20 the len field indicates
35  *      which we've returned.
36  */
37 unsigned char *get_fingerprint(struct openpgp_packet *packet,
38         unsigned char *fingerprint,
39         size_t *len);
40
41 /**
42  *      get_packetid - Given a PGP packet returns the keyid.
43  *      @packet: The packet to calculate the id for.
44  *
45  *      This function returns the key id for a given PGP packet.
46  */
47 uint64_t get_packetid(struct openpgp_packet *packet);
48
49 #endif /* __KEYID_H__ */