mastercard-client-encryption 1.3.1 → 1.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e79a9ddfdb73e2c42f7ce52a0efebda9fe1db59cca834099c51f6c108a5c16dd
4
- data.tar.gz: c49c9f80b87e474cd0419a396d7a044ec1bab711d316426a1380388c80a29557
3
+ metadata.gz: 0024fa56c6e105af72c779f16fec2324f8682e5935f4d3b75d76dcb48525931f
4
+ data.tar.gz: c8acb69255ec5d1eb6468f20309d90a69226925de92ab4dc9b9487ce29319cec
5
5
  SHA512:
6
- metadata.gz: fc340ccc66e6ea34d4a2196e067cfa82e88d7e3c3868e4b24a272635e5f8d013b4e09154086990a6151e6ebb1b75d42a47c8e76791cfdba22ce23450fa661417
7
- data.tar.gz: 6913329c0b378826114888da546646515e9740ea3c1299c334c8051630ae1b7eb07d2e58950e0a0fb2e2c68cd3a7b059db14f692db88932f9190c57ab617cab3
6
+ metadata.gz: c4c24553ed212192c1ea6a5b986add1708d7dab65510bc200d6e56fff7791e47bf6f13ede2557656f679a2dda0469c90524ece46c972cb40b702706d0b0a878c
7
+ data.tar.gz: 4b7648f90a8071014f3e550f30108da0843505d8ec35e741a8ae081517156439598466dc294c7fed82c6369c2e89e4b59ae5ddc6c4d41c49a65ca7b831b4bc2f
@@ -23,8 +23,6 @@ module McAPI
23
23
  @cert = OpenSSL::X509::Certificate.new(IO.binread(config['encryptionCertificate']))
24
24
  if config['privateKey']
25
25
  @private_key = OpenSSL::PKey.read(IO.binread(config['privateKey']))
26
- elsif config['keyStore']
27
- @private_key = OpenSSL::PKCS12.new(IO.binread(config['keyStore']), config['keyStorePassword']).key
28
26
  end
29
27
  @oaep_hashing_alg = config['oaepPaddingDigestAlgorithm']
30
28
  @encrypted_value_field_name = config['encryptedValueFieldName']
@@ -23,8 +23,6 @@ module McAPI
23
23
  @cert = OpenSSL::X509::Certificate.new(IO.binread(config['encryptionCertificate']))
24
24
  if config['privateKey']
25
25
  @private_key = OpenSSL::PKey.read(IO.binread(config['privateKey']))
26
- elsif config['keyStore']
27
- @private_key = OpenSSL::PKCS12.new(IO.binread(config['keyStore']), config['keyStorePassword']).key
28
26
  end
29
27
  @encrypted_value_field_name = config['encryptedValueFieldName'] || 'encryptedData'
30
28
  @public_key_fingerprint = compute_public_fingerprint
@@ -86,6 +84,10 @@ module McAPI
86
84
 
87
85
  if enc_method == "A256GCM"
88
86
  enc_string = "aes-256-gcm"
87
+ elsif enc_method == "A128GCM"
88
+ enc_string = "aes-128-gcm"
89
+ elsif enc_method == "A192GCM"
90
+ enc_string = "aes-192-gcm"
89
91
  elsif enc_method == "A128CBC-HS256"
90
92
  cek = cek.byteslice(16, cek.length)
91
93
  enc_string = "aes-128-cbc"
@@ -97,7 +99,7 @@ module McAPI
97
99
  cipher.decrypt
98
100
  cipher.key = cek
99
101
  cipher.iv = iv
100
- if enc_method == "A256GCM"
102
+ if enc_method == "A256GCM" || enc_method == "A128GCM" || enc_method == "A192GCM"
101
103
  cipher.auth_data = encrypted_header
102
104
  cipher.auth_tag = cipher_tag
103
105
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mastercard-client-encryption
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mastercard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-29 00:00:00.000000000 Z
11
+ date: 2023-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hamster