Skip to content

Conversation

@KostasTsiounis
Copy link
Member

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

Copy link
Member

@johnpeck-us-ibm johnpeck-us-ibm left a 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.

@KostasTsiounis
Copy link
Member Author

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 BaseTestECKeyImportInterop class. I can add some hard-coded ones for good measure though.

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>
Copy link
Member

@jasonkatonica jasonkatonica left a 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.

Copy link
Collaborator

@taoliult taoliult left a 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);
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants