add kms:ReEncrypt invalid destination key test
This commit is contained in:
parent
9ffb9d3d0a
commit
dd63cebf81
2 changed files with 21 additions and 0 deletions
|
|
@ -889,6 +889,25 @@ def test_re_encrypt_decrypt(plaintext):
|
|||
decrypt_response_1["Plaintext"].should.equal(decrypt_response_2["Plaintext"])
|
||||
|
||||
|
||||
@mock_kms
|
||||
def test_re_encrypt_to_invalid_destination():
|
||||
client = boto3.client("kms", region_name="us-west-2")
|
||||
|
||||
key = client.create_key(Description="key 1")
|
||||
key_id = key["KeyMetadata"]["KeyId"]
|
||||
|
||||
encrypt_response = client.encrypt(
|
||||
KeyId=key_id,
|
||||
Plaintext=b"some plaintext",
|
||||
)
|
||||
|
||||
with assert_raises(client.exceptions.NotFoundException):
|
||||
client.re_encrypt(
|
||||
CiphertextBlob=encrypt_response["CiphertextBlob"],
|
||||
DestinationKeyId="8327948729348",
|
||||
)
|
||||
|
||||
|
||||
@mock_kms
|
||||
def test_enable_key_rotation_key_not_found():
|
||||
client = boto3.client("kms", region_name="us-east-1")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue