gpg-interface.hon commit Git 2.7.1 (a08595f)
   1#ifndef GPG_INTERFACE_H
   2#define GPG_INTERFACE_H
   3
   4#define GPG_VERIFY_VERBOSE      1
   5#define GPG_VERIFY_RAW          2
   6
   7struct signature_check {
   8        char *payload;
   9        char *gpg_output;
  10        char *gpg_status;
  11
  12        /*
  13         * possible "result":
  14         * 0 (not checked)
  15         * N (checked but no further result)
  16         * U (untrusted good)
  17         * G (good)
  18         * B (bad)
  19         */
  20        char result;
  21        char *signer;
  22        char *key;
  23};
  24
  25extern void signature_check_clear(struct signature_check *sigc);
  26extern size_t parse_signature(const char *buf, unsigned long size);
  27extern void parse_gpg_output(struct signature_check *);
  28extern int sign_buffer(struct strbuf *buffer, struct strbuf *signature, const char *signing_key);
  29extern 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);
  30extern int git_gpg_config(const char *, const char *, void *);
  31extern void set_signing_key(const char *);
  32extern const char *get_signing_key(void);
  33extern int check_signature(const char *payload, size_t plen,
  34        const char *signature, size_t slen, struct signature_check *sigc);
  35void print_signature_buffer(const struct signature_check *sigc, unsigned flags);
  36
  37#endif