6995421: Eliminate the static dependency to sun.security.ec.ECKeyFactory

Stephen Flores stephen.flores at oracle.com
Fri Jul 20 13:18:20 PDT 2012

Please review the following webrev:


for bug: 6995421 Eliminate the static dependency to 

Description of the problem:

sun.security.x509.AlgorithmId and sun.security.pkcs11.P11ECKeyFactory
depend on an public static fields sun.security.ec.ECKeyFactory

Also, while debuging I found that ECPublicKeyImpl did not check for 
missing domain parameters while parsing a key, the way ECPrivateKeyImpl 


At the time of development of AlgorithmId there was no public provider 
for EC Key Factory, a public provider has been added since.

Description of fix:

Since code in sun.security.x509.AlgorithmId the used the provider in 
ECKeyFactory was removed since the call to the public API now provides 
EC AlgorithmParameters.

sun.security.pkcs11.P11ECKeyFactory was changed to use public KeyFactory 
API to get a key factory.

Additional changes:

A null check of the alorithm parameters was added to 

The internal provider in ECKeyFactory has been removed and it entries 
move to the SunEC provider class and any references to it have been 
changed to use the public provider API.

Changed the TestEC to the the public API to get the SunEC provider the 
way applications would.

The PKCS11 test methods that are shared TestEC were changed not to 
delete the provider given to them, which did not matter in the past 
since internal provider in ECKeyFactory was being used by EC classes.



More information about the security-dev mailing list