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
Copy file name to clipboardExpand all lines: README.md
+173-29
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,9 @@
16
16
-[Usage](#usage)
17
17
*[Prerequisites](#prerequisites)
18
18
*[Adding the Library to Your Project](#adding-the-library-to-your-project)
19
-
*[Performing Field Level Encryption and Decryption](#performing-field-level-encryption-and-decryption)
19
+
*[Performing Payload Encryption and Decryption](#performing-payload-encryption-and-decryption)
20
+
*[JWE Encryption and Decryption](#jwe-encryption-and-decryption)
21
+
*[Mastercard Encryption and Decryption](#mastercard-encryption-and-decryption)
20
22
*[Integrating with OpenAPI Generator API Client Libraries](#integrating-with-openapi-generator-api-client-libraries)
21
23
22
24
@@ -27,28 +29,22 @@ This is the Python version of the Mastercard compliant payload encryption/decryp
27
29
Python 3.6+
28
30
29
31
### References <aname="references"></a>
30
-
31
-
<imgsrc="https://user-images.githubusercontent.com/3964455/55345820-c520a280-54a8-11e9-8235-407199fa1d97.png"alt="Encryption of sensitivedata"width="75%"height="75%"/>
32
+
*[JSON Web Encryption (JWE)](https://datatracker.ietf.org/doc/html/rfc7516)
33
+
*[Securing Sensitive Data Using Payload Encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/)
32
34
33
35
## Usage <aname="usage"></a>
34
-
35
36
### Prerequisites <aname="prerequisites"></a>
36
-
37
37
Before using this library, you will need to set up a project in the [Mastercard Developers Portal](https://developer.mastercard.com).
38
38
39
39
As part of this set up, you'll receive:
40
-
41
40
- A public request encryption certificate (aka _Client Encryption Keys_)
42
41
- A private response decryption key (aka _Mastercard Encryption Keys_)
from client_encryption.field_level_encryption_config import FieldLevelEncryptionConfig
74
71
from client_encryption.field_level_encryption import encrypt_payload, decrypt_payload
75
72
```
76
73
77
-
### Performing Field Level Encryption and Decryption <aname="performing-field-level-encryption-and-decryption"></a>
74
+
```python
75
+
# JWE Encryption/Decryption
76
+
from client_encryption.jwe_encryption_config import JweEncryptionConfig
77
+
from client_encryption.jwe_encryption import encrypt_payload, decrypt_payload
78
+
```
78
79
79
-
-[Introduction](#introduction)
80
-
-[Configuring the Field Level Encryption](#configuring-the-field-level-encryption)
81
-
-[Performing Encryption](#performing-encryption)
82
-
-[Performing Decryption](#performing-decryption)
80
+
### Performing Payload Encryption and Decryption <aname="performing-payload-encryption-and-decryption"></a>
83
81
84
-
#### Introduction <aname="introduction"></a>
82
+
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.
83
+
84
+
+[JWE Encryption and Decryption](#jwe-encryption-and-decryption)
85
+
+[Mastercard Encryption and Decryption](#mastercard-encryption-and-decryption)
86
+
87
+
#### JWE Encryption and Decryption <aname="jwe-encryption-and-decryption"></a>
88
+
89
+
+[Introduction](#jwe-introduction)
90
+
+[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_payload()`/`decrypt_payload()` functions for each API request or response.
411
+
This method will add the Mastercard/JWE 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_payload()`/`decrypt_payload()` functions for each API request or response.
0 commit comments