cmake: enable hardening compiler flags and fix the reported issues
[project/ucert.git] / usign.h
1 /*
2 * usign/signify API header
3 * Copyright (C) 2018 Daniel Golle <daniel@makrotopia.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3
7 * as published by the Free Software Foundation
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15 #ifndef _USIGN_H
16 #define _USIGN_H
17
18 /**
19 * Verify
20 *
21 * calls: usign -V ...
22 */
23 int usign_v(const char *msgfile, const char *pubkeyfile,
24 const char *pubkeydir, const char *sigfile, bool quiet);
25
26 /**
27 * Sign
28 *
29 * calls: usign -S ...
30 */
31 int usign_s(const char *msgfile, const char *seckeyfile, const char *sigfile, bool quiet);
32
33 /**
34 * Fingerprint {pubkey, seckey, sig}
35 *
36 * calls: usign -F ...
37 */
38 int usign_f_pubkey(char *fingerprint, const char *pubkeyfile);
39
40 int usign_f_seckey(char *fingerprint, const char *seckeyfile);
41
42 int usign_f_sig(char *fingerprint, const char *sigfile);
43
44 /**
45 * custom extension to check for revokers
46 */
47 int _usign_key_is_revoked(const char *fingerprint, const char *pubkeydir);
48
49 #endif /* _USIGN_H */