aws-nitro-enclaves-sdk-c
aws-nitro-enclaves-sdk-c copied to clipboard
Custom encryption context
We're looking to include a custom encryption context for encrypt/decrypt operations. aws_kms_encrypt_blocking() and aws_kms_decrypt_blocking() do not expose the encryption context as an argument, and there doesn't seem to be a way to use a custom aws_kms_encrypt_request or aws_kms_decrypt_request struct aside from locally copying the code within aws_kms_encrypt_blocking() and aws_kms_decrypt_blocking().
Would it be possible to either add encrypt/decrypt functions that accept an encryption context to the SDK, or add encrypt/decrypt functions that accept a pre-formed aws_kms_encrypt_request/aws_kms_decrypt_request struct?
Yes, adding an encryption context would be useful for sure. Providing an API which can provide the request structure directly would probably work for this.
Pull requests #145 and #146 added new APIs:
- from #145:
aws_kms_decrypt_blocking_from_requestandaws_kms_encrypt_blocking_from_requestwhich allow to pass user-preparedaws_kms_encrypt_requestoraws_kms_decrypt_requeststructs. - from #146:
aws_kms_decrypt_blocking_with_contextandaws_kms_encrypt_blocking_from_requestwhich are similar toaws_kms_encrypt_blocking/aws_kms_decrypt_blockingbut allow to pass a string with a JSON containing the Encryption context.
These new APIs should be sufficient to consider this issue as resolved.