Skip to content

Commit a68a0b5

Browse files
Updating wording
1 parent 6e33ad5 commit a68a0b5

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/examples/java/com/amazonaws/crypto/examples/FileStreamingExample.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ static void encryptAndDecrypt(final File srcFile, final File encryptedFile, fina
6363
// 1. Instantiate the SDK
6464
final AwsCrypto crypto = new AwsCrypto();
6565

66-
// 2. Retrieve an encryption key. In this example, we generate a random key.
67-
// In practice, you would get a key from an existing store
68-
final SecretKey cryptoKey = retrieveEncryptionKey();
66+
// 2. Get an encryption key. In this example, we generate a random key.
67+
// In practice, you would get a key from an existing key store
68+
final SecretKey cryptoKey = generateEncryptKey();
6969

7070
// 3. Instantiate a RawAesKeyring using the random key
7171
final Keyring keyring = StandardKeyrings.rawAes()
@@ -124,7 +124,7 @@ static void encryptAndDecrypt(final File srcFile, final File encryptedFile, fina
124124
* In practice, this key would be saved in a secure location.
125125
* For this demo, we generate a new random key for each operation.
126126
*/
127-
private static SecretKey retrieveEncryptionKey() {
127+
private static SecretKey generateEncryptKey() {
128128
SecureRandom rnd = new SecureRandom();
129129
byte[] rawKey = new byte[16]; // 128 bits
130130
rnd.nextBytes(rawKey);

src/examples/java/com/amazonaws/crypto/examples/RawAesKeyringExample.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.amazonaws.encryptionsdk.keyrings.Keyring;
2121
import com.amazonaws.encryptionsdk.keyrings.StandardKeyrings;
2222

23+
import javax.crypto.KeyGenerator;
2324
import javax.crypto.SecretKey;
2425
import javax.crypto.spec.SecretKeySpec;
2526
import java.nio.charset.StandardCharsets;
@@ -44,9 +45,9 @@ static void encryptAndDecrypt() {
4445
// 1. Instantiate the SDK
4546
final AwsCrypto crypto = new AwsCrypto();
4647

47-
// 2. Retrieve an encryption key. In this example, we generate a random key.
48-
// In practice, you would get a key from an existing store
49-
final SecretKey cryptoKey = retrieveEncryptionKey();
48+
// 2. Get an encryption key. In this example, we generate a random key.
49+
// In practice, you would get a key from an existing key store
50+
final SecretKey cryptoKey = generateEncryptKey();
5051

5152
// 3. Instantiate a Raw AES Keyring with the encryption key
5253
final Keyring keyring = StandardKeyrings.rawAes()
@@ -98,7 +99,7 @@ static void encryptAndDecrypt() {
9899
* In practice, this key would be saved in a secure location.
99100
* For this demo, we generate a new random key for each operation.
100101
*/
101-
private static SecretKey retrieveEncryptionKey() {
102+
private static SecretKey generateEncryptKey() {
102103
SecureRandom rnd = new SecureRandom();
103104
byte[] rawKey = new byte[16]; // 128 bits
104105
rnd.nextBytes(rawKey);

0 commit comments

Comments
 (0)