module Gpgr
Gpgr by Ryan Stenhouse <ryan@ryanstenhouse.eu>, March 2010 on behalf of Purchasing Card Consultancy Limited.
gpgr is a very light interface to the command-line GPG (GNU Privacy Guard) tool which is soley concerned with making it as easy as possible to encrypt files with one (or more) public keys.
It does not provide any major key management tools and does not support decryption.
Usage:
require 'rubygems' require 'gpgr' # Synopsis # list_of_keys = [ 'foo@example.com', 'bar@example.com' ] Gpgr::Encrypt.file('/some_file.txt', :to => '/encrypted.gpg').encrypt_using(list_of_keys) # To import all the public keys in a given directory # Gpgr::Keys.import_keys_at('/path/to/public/keys') # Will encrypt for every single person you have a public key for # Gpgr::Encrypt.file('/some_file.txt', :to => '/encrypted.gpg').encrypt_using(Gpgr::Keys.installed_public_keys)
Public Class Methods
Returns the command to execute to run GPG. It is defualted to /use/bin/env gpg which should correctly track down gpg on any UNIX-like operating system. If you need to use this on Windows, simply change the method to return the path to where gpg is installed.
Of course, since grep is used in this script too, you'll need a windows version of grep installed as well!
# File lib/gpgr.rb, line 40 def self.command '/usr/bin/env gpg' end