-
Notifications
You must be signed in to change notification settings - Fork 122
Define the MultiKeyring #148
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
Conversation
|
||
MultiKeyring(Keyring generatorKeyring, List<Keyring> childrenKeyrings) { | ||
this.generatorKeyring = generatorKeyring; | ||
this.childrenKeyrings = childrenKeyrings == null ? emptyList() : unmodifiableList(childrenKeyrings); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth making a defensive copy of childrenKeyrings
. unmodifiableList
keeps you from modifying it, not anyone else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I'll make this change in the KmsKeyring too
src/main/java/com/amazonaws/encryptionsdk/keyrings/StandardKeyrings.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multikeyring logic follows spec and tests LGTM. Make sure this also gets the OK from a Java expert.
requireNonNull(decryptionMaterials, "decryptionMaterials are required"); | ||
requireNonNull(encryptedDataKeys, "encryptedDataKeys are required"); | ||
|
||
if (decryptionMaterials.hasPlaintextDataKey()) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are all important for every keyring.
The fact that this code is here in the MultiKeyring implies to me that it will need to be in every keyring?
While not the end of the world,
this does mean that if we have people write their own keyring
they will need to remember to include this.
Description of changes:
This change contains the initial implementation of the Multi Keyring.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Check any applicable: