pedicel-pay 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pedicel-pay/backend.rb +8 -4
- data/lib/pedicel-pay/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c8846c27908c71a5c71b3d6cdab7457effead859afed3e3cc5d71a5c206bae1
|
4
|
+
data.tar.gz: 6248a8df827cfb068573f26dfb831b43c21a5e9d6509db0acd7383224b14fefa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '098b8e789ae5f4db37c7cc169e3e406cdaa304415d0cb0b2ecfafcbaeedf6af9258f35e6bedfef634a35f7028d8ef28feb7a3ac864141d6b21b6d9a2d72f8b99'
|
7
|
+
data.tar.gz: b4a050fe6fb05ae78cd86613bacaf2da234c8711def144731c3cbc307bd0fb279a6bb4dbfcc4a1fbf1caa1627b1d685aabab92d4a4113fdbdbd2805c9a584188
|
data/lib/pedicel-pay/backend.rb
CHANGED
@@ -85,7 +85,7 @@ module PedicelPay
|
|
85
85
|
token
|
86
86
|
end
|
87
87
|
|
88
|
-
def sign(token, certificate: leaf_certificate, key: leaf_key)
|
88
|
+
def sign(token, certificate: leaf_certificate, key: leaf_key, replace: true)
|
89
89
|
raise ArgumentError, 'token has no encrypted_data' unless token.encrypted_data
|
90
90
|
raise ArgumentError, 'token has no ephemeral_pubkey' unless token.header.ephemeral_pubkey
|
91
91
|
|
@@ -104,9 +104,13 @@ module PedicelPay
|
|
104
104
|
OpenSSL::PKCS7::BINARY # Handle 0x00 correctly.
|
105
105
|
)
|
106
106
|
|
107
|
-
if
|
108
|
-
|
109
|
-
|
107
|
+
if replace
|
108
|
+
# Just replace token.signature.
|
109
|
+
else
|
110
|
+
if token.signature # Already signed.
|
111
|
+
existing_signature = OpenSSL::PKCS7.new(Base64.strict_decode64(token.signature))
|
112
|
+
signature = existing_signature.add_signer(signature.signers.first)
|
113
|
+
end
|
110
114
|
end
|
111
115
|
|
112
116
|
token.signature = Base64.strict_encode64(signature.to_der)
|
data/lib/pedicel-pay/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pedicel-pay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clearhaus A/S
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|