xmldsig 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/lib/xmldsig/signature.rb +1 -1
- data/lib/xmldsig/version.rb +1 -1
- data/spec/lib/xmldsig_spec.rb +5 -0
- metadata +3 -3
data/README.md
CHANGED
@@ -58,11 +58,11 @@ end
|
|
58
58
|
# Validation
|
59
59
|
|
60
60
|
signed_document = Xmldsig::SignedDocument.new(signed_xml)
|
61
|
-
signed_document.
|
61
|
+
signed_document.validate(certificate)
|
62
62
|
|
63
63
|
# With block
|
64
64
|
signed_document = Xmldsig::SignedDocument.new(signed_xml)
|
65
|
-
signed_document.
|
65
|
+
signed_document.validate do |signature_value, data|
|
66
66
|
certificate.public_key.verify(OpenSSL::Digest::SHA256.new, signature_value, data)
|
67
67
|
end
|
68
68
|
```
|
data/lib/xmldsig/signature.rb
CHANGED
data/lib/xmldsig/version.rb
CHANGED
data/spec/lib/xmldsig_spec.rb
CHANGED
@@ -14,6 +14,11 @@ describe Xmldsig do
|
|
14
14
|
signed_document = unsigned_document.sign(private_key)
|
15
15
|
Xmldsig::SignedDocument.new(signed_document).validate(certificate).should be_true
|
16
16
|
end
|
17
|
+
|
18
|
+
it 'should have a signature element' do
|
19
|
+
signed_document = unsigned_document.sign(private_key)
|
20
|
+
Xmldsig::SignedDocument.new(signed_document).signatures.count.should == 1
|
21
|
+
end
|
17
22
|
end
|
18
23
|
end
|
19
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xmldsig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01
|
12
|
+
date: 2013-06-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
|
-
rubygems_version: 1.8.
|
93
|
+
rubygems_version: 1.8.25
|
94
94
|
signing_key:
|
95
95
|
specification_version: 3
|
96
96
|
summary: This gem is a (partial) implementation of the XMLDsig specification (http://www.w3.org/TR/xmldsig-core)
|