Merge branch 'rj/remove-unused-mktemp' into maint
[git/raj.git] / gpg-interface.h
blobd2d4fd3a656e3f4953aea5eda3eea435f37f237e
1 #ifndef GPG_INTERFACE_H
2 #define GPG_INTERFACE_H
4 #define GPG_VERIFY_VERBOSE 1
5 #define GPG_VERIFY_RAW 2
6 #define GPG_VERIFY_OMIT_STATUS 4
8 struct signature_check {
9 char *payload;
10 char *gpg_output;
11 char *gpg_status;
14 * possible "result":
15 * 0 (not checked)
16 * N (checked but no further result)
17 * U (untrusted good)
18 * G (good)
19 * B (bad)
21 char result;
22 char *signer;
23 char *key;
26 extern void signature_check_clear(struct signature_check *sigc);
27 extern size_t parse_signature(const char *buf, unsigned long size);
28 extern void parse_gpg_output(struct signature_check *);
29 extern int sign_buffer(struct strbuf *buffer, struct strbuf *signature, const char *signing_key);
30 extern int verify_signed_buffer(const char *payload, size_t payload_size, const char *signature, size_t signature_size, struct strbuf *gpg_output, struct strbuf *gpg_status);
31 extern int git_gpg_config(const char *, const char *, void *);
32 extern void set_signing_key(const char *);
33 extern const char *get_signing_key(void);
34 extern int check_signature(const char *payload, size_t plen,
35 const char *signature, size_t slen, struct signature_check *sigc);
36 void print_signature_buffer(const struct signature_check *sigc, unsigned flags);
38 #endif