1 #ifndef GPG_INTERFACE_H
2 #define GPG_INTERFACE_H
6 #define GPG_VERIFY_VERBOSE 1
7 #define GPG_VERIFY_RAW 2
8 #define GPG_VERIFY_OMIT_STATUS 4
10 struct signature_check {
18 * N (checked but no further result)
27 char *primary_key_fingerprint;
30 void signature_check_clear(struct signature_check *sigc);
33 * Look at GPG signed content (e.g. a signed tag object), whose
34 * payload is followed by a detached signature on it. Return the
35 * offset where the embedded detached signature begins, or the end of
36 * the data when there is no such signature.
38 size_t parse_signature(const char *buf, size_t size);
41 * Create a detached signature for the contents of "buffer" and append
42 * it after "signature"; "buffer" and "signature" can be the same
43 * strbuf instance, which would cause the detached signature appended
46 int sign_buffer(struct strbuf *buffer, struct strbuf *signature,
47 const char *signing_key);
49 int git_gpg_config(const char *, const char *, void *);
50 void set_signing_key(const char *);
51 const char *get_signing_key(void);
52 int check_signature(const char *payload, size_t plen,
53 const char *signature, size_t slen,
54 struct signature_check *sigc);
55 void print_signature_buffer(const struct signature_check *sigc,