mastercard-client-encryption 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0024fa56c6e105af72c779f16fec2324f8682e5935f4d3b75d76dcb48525931f
|
4
|
+
data.tar.gz: c8acb69255ec5d1eb6468f20309d90a69226925de92ab4dc9b9487ce29319cec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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:
|
11
|
+
date: 2023-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hamster
|