2222This is the Python version of the Mastercard compliant payload encryption/decryption.
2323
2424### Compatibility <a name =" compatibility " ></a >
25- Python 3.6, 3.7
25+ Python 3.6, 3.7, 3.8
2626
2727### References <a name =" references " ></a >
2828
@@ -125,11 +125,13 @@ decrypted_response_payload = decrypt_payload(body, config)
125125
126126The above can be either stored to a file or passed to 'FieldLevelEncryptionConfig' as dictionary:
127127``` python
128- config_dictionary = {" paths" : {... },
129- (... )
130- " decryptionKey" : " ./path/to/your/private.key" ,
131- " oaepPaddingDigestAlgorithm" : " SHA256"
128+ config_dictionary = {
129+ " paths" : {... },
130+ (... )
131+ " decryptionKey" : " ./path/to/your/private.key" ,
132+ " oaepPaddingDigestAlgorithm" : " SHA256"
132133 }
134+
133135config = FieldLevelEncryptionConfig(config_dictionary)
134136
135137config_file_path = " ./config.json"
@@ -263,7 +265,7 @@ This method will add the field level encryption in the generated OpenApi client,
263265
264266##### OpenAPI Generator <a name =" openapi-generator " ></a >
265267
266- OpenAPI client can be generated, starting from your OpenAPI Spec / Swagger using the following command:
268+ OpenAPI client can be generated, starting from your OpenAPI Spec using the following command:
267269
268270``` shell
269271java -jar openapi-generator-cli.jar generate -i openapi-spec.yaml -l python -o out
@@ -281,11 +283,11 @@ To use it:
281283
2822841 . Generate the [ OpenAPI client] ( #openapi-generator )
283285
284- 2 . Import the ** mastercard-client-encryption** module and the generated swagger ApiClient
286+ 2 . Import the ** mastercard-client-encryption** module and the generated OpenAPI client
285287
286288 ``` python
287289 from client_encryption.api_encryption import add_encryption_layer
288- from swagger_client .api_client import ApiClient # import generated swagger ApiClient
290+ from openapi_client .api_client import ApiClient # import generated OpenAPI client
289291 ```
290292
2912933 . Add the field level encryption layer to the generated client:
@@ -319,12 +321,12 @@ According to the above the signing layer must be applied first in order to work
319321
3203221 . Generate the [ OpenAPI client] ( #openapi-generator )
321323
322- 2 . Import both ** mastercard-oauth1-signer** and ** mastercard-client-encryption** modules and the generated swagger ApiClient
324+ 2 . Import both ** mastercard-oauth1-signer** and ** mastercard-client-encryption** modules and the generated OpenAPI client
323325
324326 ``` python
325327 from oauth1.signer_interceptor import add_signing_layer
326328 from client_encryption.api_encryption import add_encryption_layer
327- from swagger_client .api_client import ApiClient # import generated swagger ApiClient
329+ from openapi_client .api_client import ApiClient # import generated OpenAPI client
328330 ```
329331
3303323 . Add the authentication layer to the generated client:
0 commit comments