Skip to content

Commit 47fd984

Browse files
committed
Updated README.md (part 2)
1 parent 890dd92 commit 47fd984

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Certificate encryptionCertificate = EncryptionUtils.loadEncryptionCertificate("<
6464

6565
### Loading the Decryption Key <a name="loading-the-decryption-key"></a>
6666

67-
#### From a PKCS#12 file
67+
#### From a PKCS#12 File
6868

6969
A `PrivateKey` key object can be created from a PKCS#12 file by calling the `EncryptionUtils.loadDecryptionKey` method:
7070
```java
@@ -74,14 +74,14 @@ PrivateKey decryptionKey = EncryptionUtils.loadDecryptionKey(
7474
"<insert key password>");
7575
```
7676

77-
#### From a PKCS#8 (DER) encoded content
77+
#### From a PKCS#8 Formatted Key
7878

7979
A `PrivateKey` object can be created from a PKCS#8 key file by calling the `EncryptionUtils.loadDecryptionKey` method:
8080
```java
8181
PrivateKey decryptionKey = EncryptionUtils.loadDecryptionKey("<insert PKCS#8 file path>");
8282
```
8383

84-
#### From a PEM file
84+
#### From a PEM Formatted Key
8585

8686
Reading PEM encoded keys requires an additional step:
8787

@@ -91,9 +91,13 @@ Reading PEM encoded keys requires an additional step:
9191
### Performing Field Level Encryption and Decryption <a name="performing-field-level-encryption-and-decryption"></a>
9292
The methods that do all the heavy lifting are `encryptPayload` and `decryptPayload` in the `FieldLevelEncryption` class.
9393

94-
Usage:
94+
`encryptPayload` usage:
9595
```java
9696
String encryptedRequestPayload = FieldLevelEncryption.encryptPayload(requestPayload, config);
97+
```
98+
99+
`decryptPayload` usage:
100+
```java
97101
String responsePayload = FieldLevelEncryption.decryptPayload(encryptedResponsePayload, config);
98102
```
99103

@@ -113,7 +117,7 @@ FieldLevelEncryptionConfig config = FieldLevelEncryptionConfigBuilder.aFieldLeve
113117
.build();
114118
```
115119

116-
See also: [FieldLevelEncryptionConfig.java](TODO)
120+
See also [FieldLevelEncryptionConfig.java](https://github.com/Mastercard/client-encryption-java/blob/master/src/main/java/com/mastercard/developer/encryption/FieldLevelEncryptionConfig.java) for all config options.
117121

118122
#### Performing Encryption
119123

@@ -162,8 +166,8 @@ Encrypted response payload:
162166
"to": {
163167
"encryptedFoo": {
164168
"iv": "e5d313c056c411170bf07ac82ede78c9",
165-
"encryptedKey": "e3a56746c0f9109d18b3a2d91619e6cac86bcc7b09652b76(...)f16d8af7e006440f17677eaaeff36b2479652f5c24ae7bd",
166-
"encryptedValue": "809a09d78257af5379df0c454dfa9c3e2ecf5787430775ebcf(...)409d8d27ab29803353cded59fe72fd4a7735c69da4080e74f",
169+
"encryptedKey": "e3a56746c0f9109d18b3a2d91619e6cac8c7b09652b76(...)f16d8af7e006440f17677eaaeff36b2479652f5c24ae7bd",
170+
"encryptedValue": "809a09d78257af5379df0c454dfa9c32ecf5787430775ebcf(...)409d8d27ab29803353cded59fe72fd4a7735c69da4080e74f",
167171
"oaepHashingAlgorithm": "SHA256"
168172
}
169173
}

0 commit comments

Comments
 (0)