-
Couldn't load subscription status.
- Fork 18
Refactor ECPrivateKey and allow getting public key #834
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
base: main
Are you sure you want to change the base?
Conversation
aa94062 to
3d9d4a7
Compare
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 are testing Key import we should try importing the key from SunEC as well. Also, having some hard coded encodings and importing from those is another good test.
We are already importing Sun and BC keys in the |
The ECPrivateKey class is refactored to consolidate a single point of performing encoding operations. Functionality is added to allow saving the public key if provided with the private key encoding. Signed-off-by: Kostas Tsiounis <kostas.tsiounis@ibm.com>
f8ae985 to
3fd000c
Compare
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.
Only other comment i have is that perhaps we could add some bad encodings in the KAT to drive failing paths. However I am not sure if this is worth the effort to create bad encodings in order to drive them. Other then that this PR LGTM.
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 didn’t see any issues, this PR LGTM.
| */ | ||
| private byte[] createEncodedPrivateKeyWithParams() throws IOException { | ||
| DerInputStream privKeyBytesEncodedStream = new DerInputStream(this.privKeyMaterial); | ||
| DerValue[] inputDerValue = privKeyBytesEncodedStream.getSequence(4); |
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.
we have one additional value from the encoded?
The
ECPrivateKeyclass is refactored to consolidate a single point of performing encoding operations.Functionality is added to allow saving the public key if provided with the private key encoding.
Signed-off-by: Kostas Tsiounis kostas.tsiounis@ibm.com