11 #include "keystructs.h"
14 int main(int argc, char *argv[])
16 struct openpgp_packet_list *packets = NULL;
19 struct openpgp_packet_list *list_end = NULL;
20 struct openpgp_publickey *keys = NULL;
21 struct openpgp_publickey *newkeys = NULL;
24 fputs("Doing read_openpgp_stream():\n", stderr);
25 read_openpgp_stream(getnextchar, ctx, &packets, 0);
27 fputs("Doing dearmor_openpgp_stream():\n", stderr);
28 dearmor_openpgp_stream(stdin_getchar, NULL, &packets);
29 fputs("Doing armor_openpgp_stream():\n", stderr);
30 armor_openpgp_stream(stdout_putchar, NULL, packets);
33 fputs("Doing parse_keys():\n", stderr);
34 parse_keys(packets, &keys);
36 printf("Key id is 0x%llX\n", get_keyid(keys));
38 key_index(keys, true, false, false);
41 fetch_key(get_keyid(keys), &newkeys);
44 printf("New key id is 0x%llX\n", get_keyid(newkeys));
46 fputs("Doing flatten_publickey():\n", stderr);
47 flatten_publickey(keys, &newpackets, &list_end);
49 fputs("Doing write_openpgp_stream():\n", stderr);
50 write_openpgp_stream(putnextchar, ctx, newpackets);