xmldsign 0.1.6 → 0.2.0.beta
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.
- checksums.yaml +8 -8
- data/.gitignore +1 -0
- data/Rakefile +16 -0
- data/lib/xmldsign/transforms.rb +17 -4
- data/lib/xmldsign/version.rb +1 -1
- data/spec/assets/act-birth-for-sign.xml +2 -4
- data/spec/assets/signed-act-birth.xml +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODY4N2JkMmNhYjlmMzI4YWNiZDFlOTAwNDYxNGEwM2NjOWRjODkwYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTMzMTA2MGI0NjZiNGE1YTRkZTcyZTliYWYyYjQ2ZTBlMTA2YWFlNg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWI2NWFkYmEwNzAyNDdjNmY4MmZlMjlhMTdlYTliNWM0NWY4ZjU2MDhhNjJm
|
10
|
+
ZDI4YTM5NDU0MDE3NTA2YTA0NGVlZjNlYzg5Y2Q1OTgyN2UzMzI3YWE4ZWQz
|
11
|
+
YjViM2Q1M2RhNmUzNWY5YmUxZTY1OTRhMzA0ZTQyOGY4YjY5MTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjkwZjY2ODUxZThlNjMzZDI5OGNjMTBjM2I1ZTBmNWVkMjc3OTdiMWRkMDIx
|
14
|
+
MTQ0OWFjMGExZTc4MTEwZjU2Nzg2ZjYxMjZhZDkxNTRlYTMyZDk1YmIxZmNh
|
15
|
+
ZGYyNjYyOGQ4ODQzMjg5YzVmZmFmNDg4Mjc0MGEyNGE4YTE4MDQ=
|
data/Rakefile
CHANGED
@@ -1 +1,17 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
|
4
|
+
RSpec::Core::RakeTask.new('spec')
|
5
|
+
|
6
|
+
task :build_native_extension do
|
7
|
+
Dir.chdir('ext/xmldsign') do
|
8
|
+
output = `ruby extconf.rb`
|
9
|
+
raise output unless $? == 0
|
10
|
+
output = `make`
|
11
|
+
raise output unless $? == 0
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
task :spec => :build_native_extension
|
16
|
+
|
17
|
+
task :default => :spec
|
data/lib/xmldsign/transforms.rb
CHANGED
@@ -1,9 +1,22 @@
|
|
1
1
|
module Xmldsign
|
2
2
|
class Transforms < DelegateClass(XML::Node)
|
3
|
-
def execute
|
4
|
-
|
5
|
-
|
6
|
-
algorithms.inject(
|
3
|
+
def execute
|
4
|
+
signing_doc = LibXML::XML::Document.new
|
5
|
+
signing_doc.root = signing_node.copy(true)
|
6
|
+
algorithms.inject(signing_doc) { |d, algorithm| algorithm.execute d }
|
7
|
+
end
|
8
|
+
|
9
|
+
def signing_node
|
10
|
+
if (reference_uri = reference[:URI] and not reference_uri.empty?)
|
11
|
+
id = reference_uri.sub!('#', '')
|
12
|
+
doc.find_first("//*[@wsu:Id='#{id}']")
|
13
|
+
else
|
14
|
+
doc.root
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def reference
|
19
|
+
doc.find_first('.//ds:Reference')
|
7
20
|
end
|
8
21
|
|
9
22
|
def algorithms
|
data/lib/xmldsign/version.rb
CHANGED
@@ -105,12 +105,10 @@
|
|
105
105
|
<ds:DigestValue/>
|
106
106
|
</ds:Reference>
|
107
107
|
</ds:SignedInfo>
|
108
|
-
<ds:SignatureValue>
|
109
|
-
</ds:SignatureValue>
|
108
|
+
<ds:SignatureValue></ds:SignatureValue>
|
110
109
|
<ds:KeyInfo>
|
111
110
|
<ds:X509Data>
|
112
|
-
<ds:X509Certificate>
|
113
|
-
</ds:X509Certificate>
|
111
|
+
<ds:X509Certificate></ds:X509Certificate>
|
114
112
|
</ds:X509Data>
|
115
113
|
</ds:KeyInfo>
|
116
114
|
</ds:Signature>
|
@@ -105,10 +105,10 @@
|
|
105
105
|
<ds:DigestValue>ZtonhLsw3V9Sr14iQUvwMJoTo0RbnXMFca2z29xIPxw=</ds:DigestValue>
|
106
106
|
</ds:Reference>
|
107
107
|
</ds:SignedInfo>
|
108
|
-
<ds:SignatureValue
|
108
|
+
<ds:SignatureValue></ds:SignatureValue>
|
109
109
|
<ds:KeyInfo>
|
110
110
|
<ds:X509Data>
|
111
|
-
<ds:X509Certificate
|
111
|
+
<ds:X509Certificate></ds:X509Certificate>
|
112
112
|
</ds:X509Data>
|
113
113
|
</ds:KeyInfo>
|
114
114
|
</ds:Signature>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xmldsign
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Sozontov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
prerelease: false
|
@@ -191,9 +191,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
191
191
|
version: '0'
|
192
192
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
193
|
requirements:
|
194
|
-
- - ! '
|
194
|
+
- - ! '>'
|
195
195
|
- !ruby/object:Gem::Version
|
196
|
-
version:
|
196
|
+
version: 1.3.1
|
197
197
|
requirements: []
|
198
198
|
rubyforge_project:
|
199
199
|
rubygems_version: 2.0.3
|