cscvs to tla changeset 3
[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 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  *      update_keys - Takes a list of public keys and updates them in the DB.
30  *      @keys: The keys to update in the DB.
31  *      @verbose: Should we output more information as we add keys?
32  *
33  *      Takes a list of keys and adds them to the database, merging them with
34  *      the key in the database if it's already present there. The key list is
35  *      update to contain the minimum set of updates required to get from what
36  *      we had before to what we have now (ie the set of data that was added to
37  *      the DB). Returns the number of entirely new keys added.
38  */
39 int update_keys(struct openpgp_publickey **keys, bool verbose);
40
41 #endif