Skip to content

StrictAwsKmsMasterKeyProvider fails with CMK Alias ARN #310

@ragona

Description

@ragona

I'm having some trouble that I've narrowed down to my usage of StrictAwsKmsMasterKeyProvider. When you provide a CMK alias to a StrictAwsKmsMasterKeyProvider 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 on decrypt 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!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions