Skip to content

Commit 850d8c9

Browse files
Merge branch 'a2b1c1-example' of github.com:caitlin-tibbetts/aws-encryption-sdk-python into a2b1c1-example
2 parents 3af7795 + 862734a commit 850d8c9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/src/one_kms_cmk_unsigned.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using one KMS CMK with an unsigned algorithm.
1515
"""
1616
import aws_encryption_sdk
17+
from aws_encryption_sdk import encrypt, decrypt
1718
from aws_encryption_sdk.identifiers import Algorithm
1819

1920

@@ -34,12 +35,12 @@ def encrypt_decrypt(key_arn, source_plaintext, botocore_session=None):
3435
kms_key_provider = aws_encryption_sdk.KMSMasterKeyProvider(**kwargs)
3536

3637
# Encrypt the plaintext using the AWS Encryption SDK. It returns the encrypted message and the header
37-
ciphertext, encrypted_message_header = aws_encryption_sdk.encrypt(
38-
algorithm=Algorithm.AES_256_GCM_IV12_TAG16, source=source_plaintext, key_provider=kms_key_provider
38+
ciphertext, encrypted_message_header = encrypt(
39+
algorithm=Algorithm.AES_256_GCM_IV12_TAG16_HKDF_SHA256, source=source_plaintext, key_provider=kms_key_provider
3940
)
4041

4142
# Decrypt the encrypted message using the AWS Encryption SDK. It returns the decrypted message and the header
42-
plaintext, decrypted_message_header = aws_encryption_sdk.decrypt(source=ciphertext, key_provider=kms_key_provider)
43+
plaintext, decrypted_message_header = decrypt(source=ciphertext, key_provider=kms_key_provider)
4344

4445
# Check if the original message and the decrypted message are the same
4546
assert source_plaintext == plaintext

0 commit comments

Comments
 (0)