-
Notifications
You must be signed in to change notification settings - Fork 56
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
Make Ed25519 KeyFactory registration Opt-in #410
Conversation
src/com/amazon/corretto/crypto/provider/AmazonCorrettoCryptoProvider.java
Show resolved
Hide resolved
|
||
// In case the user does not register Ed25519 KeyFactories by ACCP, we still need one to be used | ||
// internally. | ||
private static class EdKeyFactory extends KeyFactory { |
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.
I don't think this belongs inside the AmazonCorrettoCryptoProvider class, way too specific to a specific algorithm to be here. Maybe make it a standalone class or move it to the EvpKeyFactory class instead?
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.
KeyFactory is not intended to be instantiated explicitly: one should get an instance by calling the static factory methods KeyFactory::getInstance.
This usage is not common and EdKeyFactory
is only used by translateKey. I think it's better to be kept in this class.
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.
If we could do it all over again, I'd avoid having translateKey in this class as well. Way too much stuff inside here right now and it'd all benefit from a good refactor. Won't block the PR over it though.
src/com/amazon/corretto/crypto/provider/AmazonCorrettoCryptoProvider.java
Show resolved
Hide resolved
+ The keys generated by KeyFactory of ACCP for Ed25519 do not implemet EdEcKey interface from JCA since this interface is not present to JDKs prior to 15.
9833d41
to
d932c6e
Compare
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.