-
Notifications
You must be signed in to change notification settings - Fork 86
StrictAwsKmsMasterKeyProvider fails with CMK Alias ARN #310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey Ryan, this actually is intentional -- the Strict provider does not allow decryption with aliases, for exactly the reason you've pointed out. Using the strict ARN is our recommendation, but I understand that isn't feasible for all cases. If you want to avoid querying for key ARNs or knowing them ahead of time, you might look into the In the meantime, I see what you're saying about the documentation suggesting that aliases might work (or at least not being clear enough that they won't work). We'll get that fixed. |
Hi! We miss you too!! Created #311 to make the documentation text clearer. Closing this issue, but please re-open or cut us a new issue if you have any other questions. |
Makes total sense, thank you! I'll keep using the |
I'm having some trouble that I've narrowed down to my usage of
StrictAwsKmsMasterKeyProvider
. When you provide a CMK alias to aStrictAwsKmsMasterKeyProvider
then the encrypt works fine, but if you immediately turn around to decrypt the resulting blob, it will fail.It appears that on
encrypt
the ESDK will use the key alias, but ondecrypt
it inspects the blob and discovers the full ARN. The provider is configured with the Alias ARN, so there is a mismatch of key ID, and it fails as intended.If you use the strict ARN then it works fine, but this means that you can't just construct an alias, you have to describe the alias each time. The documentation here seems to suggest that a key alias should work, so my guess is that is a bug.
Any suggestions?
(p.s. Miss you, team!)
The text was updated successfully, but these errors were encountered: