2 * keymerge.c - Takes a key on stdin, merges it and outputs the difference.
4 * Jonathan McDowell <noodles@earth.li>
6 * Copyright 2002 Project Purple
15 #include "keystructs.h"
20 int stdin_getchar(void *ctx, size_t count, unsigned char *c)
28 } while ((ic != EOF) && (--count > 0));
32 int stdout_putchar(void *ctx, unsigned char c)
38 int main(int argc, char *argv[])
40 struct openpgp_packet_list *packets = NULL;
41 struct openpgp_packet_list *list_end = NULL;
42 struct openpgp_publickey *keys = NULL;
43 int rc = EXIT_SUCCESS;
45 dearmor_openpgp_stream(stdin_getchar, NULL, &packets);
46 if (packets != NULL) {
47 parse_keys(packets, &keys);
48 free_packet_list(packets);
52 fprintf(stderr, "Got %d new keys.\n",
57 fprintf(stderr, "No keys read.\n");
61 flatten_publickey(keys, &packets, &list_end);
65 armor_openpgp_stream(stdout_putchar, NULL, packets);
66 free_packet_list(packets);
70 fprintf(stderr, "No changes.\n");