You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 28, 2024. It is now read-only.
-[Adding the Library to Your Project](#adding-the-libraries-to-your-project)
20
-
-[Performing Field Level Encryption and Decryption](#performing-field-level-encryption-and-decryption)
20
+
-[Performing Field Level Encryption and Decryption](#performing-payload-encryption-and-decryption)
21
21
-[Integrating with OpenAPI Generator API Client Libraries](#integrating-with-openapi-generator-api-client-libraries)
22
22
23
23
## Overview <aname="overview"></a>
@@ -30,8 +30,8 @@ Ruby library for Mastercard API compliant payload encryption/decryption.
30
30
- Truffle Ruby 1.0.0+
31
31
32
32
### References <aname="references"></a>
33
-
34
-
<imgsrc="https://user-images.githubusercontent.com/3964455/55345820-c520a280-54a8-11e9-8235-407199fa1d97.png"alt="Encryption of sensitivedata"width="75%"height="75%"/>
33
+
*[JSON Web Encryption (JWE)](https://datatracker.ietf.org/doc/html/rfc7516)
34
+
*[Securing Sensitive Data Using Payload Encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/)
35
35
36
36
## Usage <aname="usage"></a>
37
37
@@ -75,20 +75,171 @@ Import the library:
75
75
```ruby
76
76
require'mcapi/encryption/openapi_interceptor'# to add the interceptor
77
77
# or
78
-
require'mcapi/encryption/field_level_encryption'# to perform ad-hoc encryption/decryption
78
+
require'mcapi/encryption/field_level_encryption'# to perform ad-hoc Mastercard encryption/decryption
79
+
require'mcapi/encryption/jwe_encryption'# to perform ad-hoc JWE encryption/decryption
79
80
```
80
81
81
82
82
83
83
-
### Performing Field Level Encryption and Decryption <aname="performing-field-level-encryption-and-decryption"></a>
84
+
### Performing Payload Encryption and Decryption <aname="performing-payload-encryption-and-decryption"></a>
84
85
85
86
-[Introduction](#introduction)
86
-
-[Configuring the Field Level Encryption](#configuring-the-field-level-encryption)
87
-
-[Performing Encryption](#performing-encryption)
88
-
-[Performing Decryption](#performing-decryption)
87
+
-[JWE Encryption and Decryption](#jwe-encryption-and-decryption)
88
+
-[Mastercard Encryption and Decryption](#mastercard-encryption-and-decryption)
89
89
90
90
#### Introduction <aname="introduction"></a>
91
91
92
+
This library supports two types of encryption/decryption, both of which support field level and entire payload encryption: JWE encryption and what the library refers to as Field Level Encryption (Mastercard encryption), a scheme used by many services hosted on Mastercard Developers before the library added support for JWE.
93
+
94
+
#### JWE Encryption and Decryption <aname="jwe-encryption-and-decryption"></a>
95
+
96
+
+[Introduction](#jwe-introduction)
97
+
+[Configuring the JWE Encryption](#configuring-the-jwe-encryption)
This method will add the field level encryption in the generated OpenApi client, taking care of encrypting request and decrypting response payloads, but also of updating HTTP headers when needed, automatically, without manually calling `encrypt()`/`decrypt()` functions for each API request or response.
400
+
The above methods will handle the encryption in the generated OpenApi client, taking care of encrypting request and decrypting response payloads, but also of updating HTTP headers when needed, automatically, without manually calling `encrypt()`/`decrypt()` functions for each API request or response.
0 commit comments