Giter Club home page Giter Club logo

gpg's Introduction

gpg-agent Go Report Card GoDoc

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.

This fork (automata-tech) adds support for the currently connected card.

This fork (Cognitive-i) does the following:

  • support for OpenPGP smart cards based on spec 3.4.1
  • support trezor-agent that connects to Ledger and Trezor devices

Things to know

There are a couple things off about this Go package, namely:

  • You can use PKCS1v15 and PSS for signing when your private keys are stored on disk, but when it's stored on a smart card you can only use PKCS1v15. The reason for this is that we can leverage the 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.
  • There is no way to know what type of key the GPG agent returns (signing, encryption or authentication), so in the case of subkeys the user has to make this distinction manually.
  • It borrows code from 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.

TODO

  • There are possibly some unnecessary type conversions happening because bufio.ReadString() is used as opposed to bufio.ReadBytes().
  • Move travis.yml to GitHub Action

License

This software is distributed under the BSD-style license found in the LICENSE file.

References

https://g10code.com/docs/scdaemon-ffg2007.pdf

gpg's People

Contributors

prep avatar louisbrunner avatar jackkleeman avatar freeaqingme avatar dovys avatar forsberg avatar stlava avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.