Skip to content

Commit 0155182

Browse files
committed
minor fix
1 parent f14eaa0 commit 0155182

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

examples/src/multithreading/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
def encrypt_and_decrypt_with_keyring(
1111
plaintext_data: bytes,
1212
keyring: IKeyring,
13-
esdk_client: aws_encryption_sdk.EncryptionSDKClient
13+
client: aws_encryption_sdk.EncryptionSDKClient
1414
):
15-
"""encrypt_and_decrypt_with_keyring how to encrypt plaintext data using a Raw AES keyring.
15+
"""Demonstrate how to encrypt and decrypt plaintext data using a keyring.
1616
17-
Usage: encrypt_and_decrypt_with_keyring(plaintext_data, keyring, esdk_client)
17+
Usage: encrypt_and_decrypt_with_keyring(plaintext_data, keyring, client)
1818
:param plaintext_data: plaintext data you want to encrypt
1919
:type: bytes
2020
:param keyring: Keyring to use for encryption.
2121
:type keyring: IKeyring
22-
:param esdk_client: The Encryption SDK client to use for encryption.
23-
:type esdk_client: aws_encryption_sdk.EncryptionSDKClient
22+
:param client: The Encryption SDK client to use for encryption.
23+
:type client: aws_encryption_sdk.EncryptionSDKClient
2424
:return: encrypted and decrypted (cycled) plaintext data
2525
:rtype: bytes
2626
"""
@@ -32,13 +32,13 @@ def encrypt_and_decrypt_with_keyring(
3232
"the data you are handling": "is what you think it is",
3333
}
3434

35-
ciphertext_data, _ = esdk_client.encrypt(
35+
ciphertext_data, _ = client.encrypt(
3636
source=plaintext_data,
3737
keyring=keyring,
3838
encryption_context=encryption_context
3939
)
4040

41-
decrypted_plaintext_data, _ = esdk_client.decrypt(
41+
decrypted_plaintext_data, _ = client.decrypt(
4242
source=ciphertext_data,
4343
keyring=keyring
4444
)

examples/src/multithreading/raw_aes_keyring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
3-
"""This file contains methdos to use for the multi-threaded Raw AES keyring."""
3+
"""This file contains methods to use for testing multi-threading for Raw AES keyring."""
44

55
import secrets
66

examples/src/multithreading/raw_rsa_keyring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
3-
"""This file contains methdos to use for the multi-threaded Raw RSA keyring."""
3+
"""This file contains methods to use for testing multi-threading for Raw RSA keyring."""
44
from aws_cryptographic_materialproviders.mpl import AwsCryptographicMaterialProviders
55
from aws_cryptographic_materialproviders.mpl.config import MaterialProvidersConfig
66
from aws_cryptographic_materialproviders.mpl.models import CreateRawRsaKeyringInput, PaddingScheme

examples/test/multithreading/test_i_raw_aes_keyring_multithreaded_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ def test_encrypt_and_decrypt_with_keyring(n_threads=10):
1818
"""Test function for multi-threaded encrypt and decrypt using the Raw AES Keyring example."""
1919
keyring = create_keyring()
2020
plaintext_data = b"Hello World"
21-
esdk_client = aws_encryption_sdk.EncryptionSDKClient(
21+
client = aws_encryption_sdk.EncryptionSDKClient(
2222
commitment_policy=CommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT
2323
)
2424

2525
with ThreadPoolExecutor(max_workers=n_threads) as executor:
2626
thread_futures = {executor.submit(encrypt_and_decrypt_with_keyring,
2727
plaintext_data=plaintext_data,
2828
keyring=keyring,
29-
esdk_client=esdk_client): i for i in range(n_threads)}
29+
client=client): i for i in range(n_threads)}
3030

3131
for future in as_completed(thread_futures):
3232
decrypted_plaintext_data = future.result()

examples/test/multithreading/test_i_raw_rsa_keyring_multithreaded_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ def test_encrypt_and_decrypt_with_keyring(n_threads=10):
1919
public_key, private_key = generate_rsa_keys()
2020
keyring = create_keyring(public_key=public_key, private_key=private_key)
2121
plaintext_data = b"Hello World"
22-
esdk_client = aws_encryption_sdk.EncryptionSDKClient(
22+
client = aws_encryption_sdk.EncryptionSDKClient(
2323
commitment_policy=CommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT
2424
)
2525

2626
with ThreadPoolExecutor(max_workers=n_threads) as executor:
2727
thread_futures = {executor.submit(encrypt_and_decrypt_with_keyring,
2828
plaintext_data=plaintext_data,
2929
keyring=keyring,
30-
esdk_client=esdk_client): i for i in range(n_threads)}
30+
client=client): i for i in range(n_threads)}
3131

3232
for future in as_completed(thread_futures):
3333
decrypted_plaintext_data = future.result()

0 commit comments

Comments
 (0)