This a GnuPG wrapper built with Ruby.
The gem api is modeled after jruby-pgp for compatibility reasons with a legacy application.
This gem is validated with multiple versions of gpg and multiple operating systems.
Add this line to your application's Gemfile:
gem 'ruby-pgp'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ruby-pgp
The feature set is very bare, and restricted to the following operations:
-
Encrypt a file to a known list of Public Key(s).
-
Decrypt a file using a given set of Private Key(s).
-
Public and Private keys may be read in from disk or from memory.
-
Verify the signature of a file that you are decrypting. (thanks, @superchris)
-
Use password-protected Private Keys. (thanks, @superchris)
-
Sign a file from the file system. (thanks, @superchris)
Currently, you cannot do the following (These are TODO items):
-
Verify any signatures of public / private keys.
-
Create new Private Keys / generate public keys from a given Private Key.
-
Sign a file that you are encrypting.
-
Obtain the name of the file that was encrypted. (Should be an easy feature to add.)
-
Obtain the "modificationTime" (timestamp) of the encrypted data / file.
-
Verify a public key based on information from a key server.
This gem currently features everything I need and nothing I don't. Pull requests are very much welcome; feature requests will be considered.
For usage examples, see the below test files:
Encryption: spec/lib/pgp/encryptor_spec.rb
Decryption: spec/lib/pgp/decryptor_spec.rb
@superchris
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Just run:
$ rspec
The .travis.yml file describes our testing strategy for multiple OS.
We run the test suite against multiple OS versions with Ruby installed.