1

I am new to Go and trying to run a simple program with GPG verify a file with my signature file.

Here is my snippet:

out, err := exec.Command("gpg", "--verify", "xyz.json.sig", "xyz.json").Output()
 if err != nil {
  fmt.Printf("%s", err)
  os.Exit(1)
 }
 fmt.Printf("The output is: %s\n", out)

When i execute this my output out is coming out empty. If i run this verify command manually from command line i get valid signature, both xyz.json.sig and xyz.json are local files next to my go file. What am i missing any idea?

Nik
  • 191
  • 2
  • 11
  • If this documentation is right, --verify does not generate output: "Assume that sigfile is a signature and verify it without generating any output." https://gnupg.org/documentation/manpage.html Does that match the man/info for gpg on your system? – jrefior Mar 20 '18 at 18:35
  • 1
    I think i figured it out, it needs CombinedOutput instead to make it work. – Nik Mar 20 '18 at 18:57

0 Answers0