This gem is a (partial) implementation of the XMLEncryption specification (http://www.w3.org/TR/xmlenc-core/)
Add this line to your application's Gemfile:
gem 'xmlenc'
And then execute:
$ bundle
Or install it yourself as:
$ gem install xmlenc
key_pem = File.read('path/to/key.pem')
xml = File.read('path/to/file.xml')
private_key = OpenSSL::PKey::RSA.new(key_pem)
encrypted_document = Xmlenc::EncryptedDocument.new(xml)
decrypted_document = encrypted_document.decrypt(private_key)
Data algorithms
- http://www.w3.org/2001/04/xmlenc#tripledes-cbc
- http://www.w3.org/2001/04/xmlenc#aes128-cbc
- http://www.w3.org/2001/04/xmlenc#aes256-cbc
- http://www.w3.org/2009/xmlenc11#aes128-gcm
- http://www.w3.org/2009/xmlenc11#aes192-gcm
- http://www.w3.org/2009/xmlenc11#aes256-gcm
Key algorithms
- http://www.w3.org/2001/04/xmlenc#rsa-1_5
- http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p (Without OAEPParams and only SHA1 digest methods)
- add encryption (in progress)
- support more algorithms
- 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