RSA Key Interfaces Was: Re: [9] RFR 8078661: [SunPKCS11] Fails to cast into RSAPrivateCrtKey after RSA KeyPair Generation

Michael StJohns mstjohns at comcast.net
Thu Aug 18 15:56:33 UTC 2016


Hi -

Looking at Valeries changes to the above made me take a closer look at 
the current definitions of the various RSA key interfaces. What would be 
the impact of the following changes?:

Make RSAMultiPrimePrivateCrtKeySpec extend RSAPrivateCrtKeyKeySpec 
instead of RSAPrivateKeySpec.  RSAMultiPrimePrivateCrtKeySpec would then 
only define the RSAOtherPrimeInfo[] getOtherPrimeInfo() method.

Ditto for RSAMultiPrimePrivateCrtKey and RSAPrivateCrtKey

Move getPublicExponent() from RSAPublicKey and RSAPrivateCrtKey to RSAKey.

Ditto for the Spec versions.


I think the first two changes can be done without adverse impact and are 
more correct than the current definitions.

The latter two are more problematic, but can probably be handled using 
the default method mechanism.

The API documents would indicate that these functions would return null 
if the values are unavailable.

Mike




More information about the security-dev mailing list