aliquot-pay 2.2.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aliquot-pay.rb +2 -15
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df10b773da7321ea564c012fd5d487c07c0779ced77d1535e3b3a10691157b39
4
- data.tar.gz: c6231c0006e33298f414ced2e286ac45ef4df5f16a2efa633a8025e1373fca15
3
+ metadata.gz: 35dfff1ebd40162ee529331539e3e84c3cd9d4584aa8c5cbcd512ad4f1bddbcd
4
+ data.tar.gz: 06405dd759121d55be37e9488f0a21b50bf710613b5d00cc9d91cbdd6bc1a6a7
5
5
  SHA512:
6
- metadata.gz: 32790400342af932a01adeaaf8cb0ed943ffe2343954972deb4d20f7e5e34482ff71ab924f395221db3affd0128cfeb8b6ae95cc19d1c19dbcedde0d2ca963a6
7
- data.tar.gz: 23aa8bec6cb97d8ec513e1fb6323f35b60f7ad1baca8627d4091e2898b1d1a03f38882b1949f34f56064bde33ba330978b84b0a69c0f321c35639bba26539d02
6
+ metadata.gz: eab0cb24c340f738da984ec910f134836cd04deee6baca6ee2946e9fdcedc0253f8aba93c71e3c9f98b36f086ae7b003fb1a3eeb5964f9a67a1b189cede7132c
7
+ data.tar.gz: 8ec410a4184ba33fd932694d77ac37978e2da7af1851c5a97ff6640aad82a8690a14114e48607cd3df1dfdbb5a71ea0525a588895574cbfe1b6dbfcf34611999
data/lib/aliquot-pay.rb CHANGED
@@ -34,7 +34,7 @@ class AliquotPay
34
34
  end
35
35
 
36
36
  def extract_root_signing_keys
37
- key = Base64.strict_encode64(eckey_to_public(ensure_root_key))
37
+ key = Base64.strict_encode64(ensure_root_key.to_der)
38
38
  {
39
39
  'keys' => [
40
40
  'protocolVersion' => @protocol_version,
@@ -43,19 +43,6 @@ class AliquotPay
43
43
  }.to_json
44
44
  end
45
45
 
46
- if OpenSSL::VERSION >= '3'
47
- # pkeys are immutable on OpenSSL >=3.0
48
- def eckey_to_public(key)
49
- key.public_to_der
50
- end
51
- else
52
- def eckey_to_public(key)
53
- k = OpenSSL::PKey::EC.new(EC_CURVE)
54
- k.public_key = key.public_key
55
- k.to_der
56
- end
57
- end
58
-
59
46
  def sign(key, message)
60
47
  d = OpenSSL::Digest::SHA256.new
61
48
  def key.private?; private_key?; end
@@ -159,7 +146,7 @@ class AliquotPay
159
146
  fail 'Intermediate key must be public and private key'
160
147
  end
161
148
 
162
- default_key_value = Base64.strict_encode64(eckey_to_public(@intermediate_key))
149
+ default_key_value = Base64.strict_encode64(@intermediate_key.to_der)
163
150
  default_key_expiration = "#{Time.now.to_i + 3600}000"
164
151
 
165
152
  @signed_key = {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliquot-pay
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clearhaus
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-27 00:00:00.000000000 Z
11
+ date: 2023-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hkdf