blob: b0273ebba6922f0badefe3803dd882edc9de1728 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#define _GNU_SOURCE
#include <error.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <sequoia/openpgp.h>
int
main (int argc, char **argv)
{
pgp_error_t err;
pgp_reader_t reader;
pgp_tpk_t tpk;
if (argc != 2)
error (1, 0, "Usage: %s <file>", argv[0]);
reader = pgp_reader_from_file (&err, argv[1]);
tpk = pgp_tpk_from_reader (&err, reader);
if (tpk == NULL)
error (1, 0, "pgp_tpk_from_reader: %s", pgp_error_to_string (err));
char *debug = pgp_tpk_debug (tpk);
printf ("%s", debug);
free (debug);
pgp_tpk_free (tpk);
pgp_reader_free (reader);
return 0;
}
|