File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 37
37
38
38
def encrypt_and_decrypt_with_keyring (
39
39
kms_rsa_key_id : str ,
40
- kms_rsa_public_key : str
40
+ public_key : str
41
41
):
42
42
"""Demonstrate an encrypt/decrypt cycle using an AWS KMS RSA keyring.
43
43
44
- Usage: encrypt_and_decrypt_with_keyring(kms_rsa_key_id, kms_rsa_public_key )
44
+ Usage: encrypt_and_decrypt_with_keyring(kms_rsa_key_id, public_key )
45
45
:param kms_rsa_key_id: KMS RSA Key identifier for the KMS RSA key you want to use
46
46
:type kms_rsa_key_id: string
47
- :param kms_rsa_public_key: KMS RSA public key you want to use
48
- :type kms_rsa_public_key : string
47
+ :param public_key: public key you want to use
48
+ :type public_key : string
49
49
50
50
For more information on KMS Key identifiers, see
51
51
https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id
@@ -82,7 +82,7 @@ def encrypt_and_decrypt_with_keyring(
82
82
)
83
83
84
84
keyring_input : CreateAwsKmsRsaKeyringInput = CreateAwsKmsRsaKeyringInput (
85
- public_key = kms_rsa_public_key ,
85
+ public_key = public_key ,
86
86
kms_key_id = kms_rsa_key_id ,
87
87
encryption_algorithm = "RSAES_OAEP_SHA_256" ,
88
88
kms_client = kms_client
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def test_encrypt_and_decrypt_with_keyring():
13
13
kms_rsa_key_id = "arn:aws:kms:us-west-2:370957321024:key/mrk-63d386cb70614ea59b32ad65c9315297"
14
14
15
15
# THIS IS A PUBLIC RESOURCE AND SHOULD NOT BE USED IN A PRODUCTION ENVIRONMENT
16
- kms_rsa_public_key = bytes ("-----BEGIN PUBLIC KEY-----\n "
16
+ public_key = bytes ("-----BEGIN PUBLIC KEY-----\n "
17
17
+ "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA27Uc/fBaMVhxCE/SpCMQ"
18
18
+ "oSBRSzQJw+o2hBaA+FiPGtiJ/aPy7sn18aCkelaSj4kwoC79b/arNHlkjc7OJFsN"
19
19
+ "/GoFKgNvaiY4lOeJqEiWQGSSgHtsJLdbO2u4OOSxh8qIRAMKbMgQDVX4FR/PLKeK"
@@ -22,4 +22,4 @@ def test_encrypt_and_decrypt_with_keyring():
22
22
+ "yy4kfOL0Z/nhxRKe4jRZ/5v508qIzgzCksYy7Y3QbMejAtiYnr7s5/d5KWw0swou"
23
23
+ "twIDAQAB"
24
24
+ "\n -----END PUBLIC KEY-----" , 'utf-8' )
25
- encrypt_and_decrypt_with_keyring (kms_rsa_key_id , kms_rsa_public_key )
25
+ encrypt_and_decrypt_with_keyring (kms_rsa_key_id , public_key )
You can’t perform that action at this time.
0 commit comments