Skip to content

Instantly share code, notes, and snippets.

@woods
Created February 25, 2014 12:48
Show Gist options
  • Save woods/9208176 to your computer and use it in GitHub Desktop.
Save woods/9208176 to your computer and use it in GitHub Desktop.
Example of using GPGME to access a keyring in a nonstandard location
# Read source here: https://github.com/ueno/ruby-gpgme
require 'gpgme'
# The given directory must contain pubring.gpg
GPGME::Engine.home_dir = 'spec/fixtures/gnupg'
GPGME::Key.find(:public) # => An array of public key objects
# Print ascii-armored public key to stdout
GPGME::Key.export("[email protected]", output: $stdout, armor: true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment