Add help text for keyd
[onak.git] / merge.h
1 /*
2  * merge.h - Routines to merge OpenPGP public keys.
3  *
4  * Jonathan McDowell <noodles@earth.li>
5  *
6  * Copyright 2002-2004 Project Purple
7  */
8
9 #ifndef __MERGE_H__
10
11 #include "keystructs.h"
12
13 /**
14  *      merge_keys - Takes 2 public keys and merges them.
15  *      @a: The old key. The merged key is returned in this structure.
16  *      @b: The new key. The changed from old to new keys are returned in this
17  *              structure.
18  *
19  *      This function takes 2 keys and merges them. It then returns the merged
20  *      key in a and the difference between this new key and the original a
21  *      in b (ie newb contains the minimum amount of detail necessary to
22  *      convert olda to newa). The intention is that olda is provided from
23  *      internal storage and oldb from the remote user. newa is then stored in
24  *      internal storage and newb is sent to all our keysync peers.
25  */
26 int merge_keys(struct openpgp_publickey *a, struct openpgp_publickey *b);
27
28 /**
29  *      get_signed_packet - Gets a signed packet from a list.
30  *      @packet_list: The list of packets to look in.
31  *      @packet: The packet to look for.
32  *
33  *      Walks through the signedpacket_list looking for the supplied packet and
34  *      returns it if found. Otherwise returns NULL.
35  */
36 struct openpgp_signedpacket_list *find_signed_packet(
37                 struct openpgp_signedpacket_list *packet_list,
38                 struct openpgp_packet *packet);
39
40 /**
41  *      merge_packet_sigs - Takes 2 signed packets and merges their sigs.
42  *      @old: The old signed packet.
43  *      @new: The new signed packet.
44  *
45  *      Takes 2 signed packet list structures and the sigs of the packets on
46  *      the head of these structures. These packets must both be the same and
47  *      the fully merged structure is returned in old and the minimal
48  *      difference to get from old to new in new.
49  */
50 int merge_packet_sigs(struct openpgp_signedpacket_list *old,
51                         struct openpgp_signedpacket_list *new);
52
53 #endif