A client to gpg-agent for Go
This is an experimental repository of a client to the GPG agent. It was built out of a desire to have a somewhat friendly interface to GPG keys stored on a smart card by way of GPG.
At this point, the interface might be subject to change.
There are a couple things off about this Go package, namely:
PKDECRYPT
functionality for both decryption and signing when the keys are stored on disk, but most smart cards won't allow a decrypt operation on a signing key. Therefore, this package needs to leverage the PKSIGN
gpg-agent command, which only returns a signature in the PKCS1v15 format.crypto/rsa
, because the interface of the rsa
package expects a private key to be provided, which is not possible when the private key is stored on a smart card. Therefore, the relevant code from crypto/rsa
was copied to an internal package in this repository where the PrivateKey{}
was changed to add a DecryptFunc
field that gets called instead of the unexported decrypt()
function in the rsa package itself.bufio.ReadString()
is used as opposed to bufio.ReadBytes()
.This software is distributed under the BSD-style license found in the LICENSE file.