signer 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/signer.rb CHANGED
@@ -148,7 +148,11 @@ class Signer
148
148
  reference_node.add_child(transforms_node)
149
149
 
150
150
  transform_node = Nokogiri::XML::Node.new('Transform', document)
151
- transform_node['Algorithm'] = 'http://www.w3.org/2001/10/xml-exc-c14n#'
151
+ if options[:enveloped]
152
+ transform_node['Algorithm'] = 'http://www.w3.org/2000/09/xmldsig#enveloped-signature'
153
+ else
154
+ transform_node['Algorithm'] = 'http://www.w3.org/2001/10/xml-exc-c14n#'
155
+ end
152
156
  transforms_node.add_child(transform_node)
153
157
 
154
158
  digest_method_node = Nokogiri::XML::Node.new('DigestMethod', document)
@@ -1,3 +1,3 @@
1
1
  class Signer
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -11,13 +11,13 @@
11
11
  <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
12
12
  <Reference URI="">
13
13
  <Transforms>
14
- <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
14
+ <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
15
15
  </Transforms>
16
16
  <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
17
17
  <DigestValue>U9tsT4lrRMp8ZdKMnblgeMCGfvI=</DigestValue>
18
18
  </Reference>
19
19
  </SignedInfo>
20
- <SignatureValue>GoikOue0l0ZZBkEoZ+kDvFJ0YJl1nW4zFLe8IsMcqPFFE2xOK1lO/YHKpc49CNQFs2ZhOiGwCseOg0F/8FUWp9hiAOTLlYrKVd61FErifakLw/mirP2SB3J9npPh6Idt9LMQWU+O+aRdyJMF7HLpx03GML2IF9ejKVUBTWTrcpU=</SignatureValue>
20
+ <SignatureValue>HpRIiW6/yGyAI0AwVaaGp3PltD3JOCFfxZLVt+kQD05u1tz9EA91/5CbvCNfn1ljoObMSGe3+W9gXFZewCXANu5VXMnt+FeZ42QYNuYj2oUCFaWlg3NcThWnehE1W/R+QPLJVgk4RxpSntNLK0WWtFy79JbAh0NO4CcD84/HEo8=</SignatureValue>
21
21
  <KeyInfo>
22
22
  <X509Data>
23
23
  <X509IssuerSerial>
data/spec/signer_spec.rb CHANGED
@@ -38,7 +38,7 @@ describe Signer do
38
38
  signer.private_key = OpenSSL::PKey::RSA.new(File.read(private_key_file), "test")
39
39
  signer.security_node = signer.document.root
40
40
  signer.security_token_id = ""
41
- signer.digest!(signer.document, :id => "")
41
+ signer.digest!(signer.document, :id => "", :enveloped => true)
42
42
  signer.sign!(:issuer_serial => true)
43
43
 
44
44
  # File.open(File.join(File.dirname(__FILE__), 'fixtures', 'output_2.xml'), "w") do |f|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: signer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,9 +9,10 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-21 00:00:00.000000000 Z
12
+ date: 2013-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
+ type: :development
15
16
  name: rake
16
17
  requirement: !ruby/object:Gem::Requirement
17
18
  none: false
@@ -19,15 +20,15 @@ dependencies:
19
20
  - - ! '>='
20
21
  - !ruby/object:Gem::Version
21
22
  version: '0'
22
- type: :development
23
- prerelease: false
24
23
  version_requirements: !ruby/object:Gem::Requirement
25
24
  none: false
26
25
  requirements:
27
26
  - - ! '>='
28
27
  - !ruby/object:Gem::Version
29
28
  version: '0'
29
+ prerelease: false
30
30
  - !ruby/object:Gem::Dependency
31
+ type: :development
31
32
  name: rspec
32
33
  requirement: !ruby/object:Gem::Requirement
33
34
  none: false
@@ -35,15 +36,15 @@ dependencies:
35
36
  - - ! '>='
36
37
  - !ruby/object:Gem::Version
37
38
  version: '0'
38
- type: :development
39
- prerelease: false
40
39
  version_requirements: !ruby/object:Gem::Requirement
41
40
  none: false
42
41
  requirements:
43
42
  - - ! '>='
44
43
  - !ruby/object:Gem::Version
45
44
  version: '0'
45
+ prerelease: false
46
46
  - !ruby/object:Gem::Dependency
47
+ type: :runtime
47
48
  name: nokogiri
48
49
  requirement: !ruby/object:Gem::Requirement
49
50
  none: false
@@ -51,14 +52,13 @@ dependencies:
51
52
  - - ! '>='
52
53
  - !ruby/object:Gem::Version
53
54
  version: 1.5.1
54
- type: :runtime
55
- prerelease: false
56
55
  version_requirements: !ruby/object:Gem::Requirement
57
56
  none: false
58
57
  requirements:
59
58
  - - ! '>='
60
59
  - !ruby/object:Gem::Version
61
60
  version: 1.5.1
61
+ prerelease: false
62
62
  description: WS Security XML signer
63
63
  email:
64
64
  - edgars.beigarts@gmail.com
@@ -89,16 +89,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
89
89
  requirements:
90
90
  - - ! '>='
91
91
  - !ruby/object:Gem::Version
92
+ segments:
93
+ - 0
92
94
  version: '0'
95
+ hash: -2151872733267505792
93
96
  required_rubygems_version: !ruby/object:Gem::Requirement
94
97
  none: false
95
98
  requirements:
96
99
  - - ! '>='
97
100
  - !ruby/object:Gem::Version
101
+ segments:
102
+ - 0
98
103
  version: '0'
104
+ hash: -2151872733267505792
99
105
  requirements: []
100
106
  rubyforge_project:
101
- rubygems_version: 1.8.24
107
+ rubygems_version: 1.8.25
102
108
  signing_key:
103
109
  specification_version: 3
104
110
  summary: WS Security XML signer