Is it possible to encrypt/decrypt a text with aws-encryption-sdk-python and using an asymmetric customer key present in KMS?

441 Views Asked by At

Is it possible to encrypt/decrypt a text using an asymmetric customer key, stored in KMS, passing it to the encrypt and decrypt functions of the aws-encryption-sdk-python? I tried this but could not pass the encryption step, it raises an error:

An error ocurred (InvalidKeyUsageException) when calling the GenerateDataKey operation: You cannot generate a data key with an assymetric CMK.
1

There are 1 best solutions below

0
Marcin On BEST ANSWER

No there is no such way. From docs:

The AWS Encryption SDK supports only symmetric encryption KMS keys. You cannot use an asymmetric KMS key for encryption or signing in the AWS Encryption SDK.