xmlenc 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05335aa8ba0dda231cdcd85250ad4230cf2ae357
4
- data.tar.gz: 530d1d9687eaf82766dc7a545743e8c202976666
3
+ metadata.gz: f42a034e24ec614a6ec82243b7fae02d7dd7568e
4
+ data.tar.gz: ee2f602d322d9d1c1fb67e723a4d88b5cc2783a5
5
5
  SHA512:
6
- metadata.gz: b289eca6391a1455116da112076b4b1ce17f2c9485bbaccde5057f24a4054b24ba14a9abbfc14644853afb361d9611e82456a706bc00d73537fc64e69d2f0381
7
- data.tar.gz: 2dcae1bea6a6b72348ef8e1f1e4974a400c402c228839c0e125c3301bd1ec54ca1bf3ff16aca2f0bb20b45d342cd3a1685cad42e925b76d508701d3d482ca911
6
+ metadata.gz: ec19ef79d4ef7c85361f62eb13a18fa3979bbce289521d1e0e1b8911f69bc5d2c2924e7afe9f458d20214bfdf92dca0ced7890d12a844fe88bd171d434e8d348
7
+ data.tar.gz: 13190ccdb5144ec116e1c43406fdb8a9912c1ed5f78e17350dd2d71c1c6f986dcf424e525d0221a8378b3a13e4c9e12440e35e7d1e2cdac0a6fccdabef4b035c
@@ -8,3 +8,4 @@ rvm:
8
8
  matrix:
9
9
  allow_failures:
10
10
  - rvm: jruby-19mode
11
+ sudo: false
@@ -12,7 +12,7 @@ module Xmlenc
12
12
  @key.private_decrypt(cipher_value, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING)
13
13
  end
14
14
 
15
- def encrypt(data)
15
+ def encrypt(data, options = {})
16
16
  @key.public_encrypt(data, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING)
17
17
  end
18
18
 
@@ -1,3 +1,3 @@
1
1
  module Xmlenc
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
@@ -114,20 +114,26 @@ describe Xmlenc::EncryptedKey do
114
114
 
115
115
  describe 'encrypt' do
116
116
  let(:template_doc) { Nokogiri::XML::Document.parse(File.read('spec/fixtures/template.xml')) }
117
+ let(:template2_doc) { Nokogiri::XML::Document.parse(File.read('spec/fixtures/template2.xml')) }
117
118
  let(:encrypted_key_template) { described_class.new(template_doc.at_xpath('//xenc:EncryptedKey', Xmlenc::NAMESPACES)) }
119
+ let(:encrypted_key_template2) { described_class.new(template2_doc.at_xpath('//xenc:EncryptedKey', Xmlenc::NAMESPACES)) }
118
120
  let(:public_key) { private_key.public_key }
119
121
  let(:data) { 'random key' }
120
122
 
121
123
  it 'stores the encrypted value in the cipher value' do
122
124
  encrypted_key_template.encrypt(public_key, data)
125
+ encrypted_key_template2.encrypt(public_key, data)
123
126
 
124
127
  expect(encrypted_key_template.cipher_value.length).to be > 0
128
+ expect(encrypted_key_template2.cipher_value.length).to be > 0
125
129
  end
126
130
 
127
131
  it 'allows decryption with the key' do
128
132
  encrypted_key_template.encrypt(public_key, data)
133
+ encrypted_key_template2.encrypt(public_key, data)
129
134
 
130
135
  expect(encrypted_key_template.decrypt(private_key)).to be == data
136
+ expect(encrypted_key_template2.decrypt(private_key)).to be == data
131
137
  end
132
138
  end
133
139
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xmlenc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoist
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-15 00:00:00.000000000 Z
11
+ date: 2016-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport