summaryrefslogtreecommitdiffstats
path: root/usign.h
blob: fc734575a76b65bc3a50ee3a82fff9c7a7b33a4c (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * usign/signify API header
 * Copyright (C) 2018 Daniel Golle <daniel@makrotopia.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3
 * as published by the Free Software Foundation
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef _USIGN_H
#define _USIGN_H

#include <stdbool.h>

/**
 * Verify
 *
 * calls: usign -V ...
 */
int usign_v(const char *msgfile, const char *pubkeyfile,
	    const char *pubkeydir, const char *sigfile, bool quiet);

/**
 * Sign
 *
 * calls: usign -S ...
 */
int usign_s(const char *msgfile, const char *seckeyfile, const char *sigfile, bool quiet);

/**
 * Fingerprint {pubkey, seckey, sig}
 *
 * calls: usign -F ...
 */
int usign_f_pubkey(char fingerprint[17], const char *pubkeyfile, bool quiet);

int usign_f_seckey(char fingerprint[17], const char *seckeyfile, bool quiet);

int usign_f_sig(char fingerprint[17], const char *sigfile, bool quiet);

/**
 * custom extension to check for revokers
 */
int _usign_key_is_revoked(const char *fingerprint, const char *pubkeydir);

#endif /* _USIGN_H */