Sorry - I'm coming to this a bit late.

Any chance of adding the logic for generatePublic() from a PKCS8 RSA private key?   RFC3477 has the PKCS1 RSAPrivateKey ASN1 which includes the modulus and publicExponent - so it should be a pretty straight forward add to generate a public key.

PKCS11 2.40 started requiring that the publicExponent be stored with the private key to allow for the public key to be regenerated from a private key object.   Going forward,  it might be a good idea to modify the RSAPrivate(Crt)KeyImpl class to store the publicExponent if provided.


Mike


On 1/14/2021 4:06 PM, Valerie Peng wrote:
On Wed, 13 Jan 2021 17:00:36 GMT, Weijun Wang <wei...@openjdk.org> wrote:

Valerie Peng has updated the pull request incrementally with one additional 
commit since the last revision:

   Update copyright year from 2020 to 2021.
test/jdk/sun/security/rsa/TestKeyFactory.java line 159:

157:                 throw new Exception("Encodings not equal");
158:             }
159:         }
Can we combine the 2 blocks above into one? That is to say, when key1 and key2 
have the same format, we check the equality of both getEncoded() and 
themselves. Same for the P11 test.
Sure, will do.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1787


Reply via email to