I have a binary file:
foo.bin
This file has been signed using a gpg key to create:
foo.bin.sig
I have a file containing the public key that was used to sign the binary file.
What I'd like to do is to be able to verify this signature using Go.
I was reading the go.crypto/openpgp docs and they aren't particularly helpful for this use case.
The verification will be done on a remote machine. Ideally I'd like to avoid using the keyring on the machine that will run this code. The public key can trivially be stored in the executable itself... if I can work out how to get this verification done.
The steps that I think I need to do are as follows:
- Create an Entity that represents only the public key
- Open both the binary file and the signature and pass it to some verification function
The question primarily is: how do I write this verification function using just a public key?
.sig
file to verify the signature. Then the crypto package should have all the methods you need. If you find the documentation about the definition of the .sig file (I did not find it), please place it here. I would like to see that too. - user983716