xmldsig 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.verify(certificate)
61
+ signed_document.validate(certificate)
62
62
 
63
63
  # With block
64
64
  signed_document = Xmldsig::SignedDocument.new(signed_xml)
65
- signed_document.verify do |signature_value, data|
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
  ```
@@ -19,7 +19,7 @@ module Xmldsig
19
19
  if reference_uri && reference_uri != ""
20
20
  document.dup.at_xpath("//*[@ID='#{reference_uri[1..-1]}']")
21
21
  else
22
- document.root
22
+ document.dup.root
23
23
  end
24
24
  end
25
25
 
@@ -1,3 +1,3 @@
1
1
  module Xmldsig
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -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.3
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-21 00:00:00.000000000 Z
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.24
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)