[15] RFR JDK-8242151 Improve OID mapping and reuse among JDK security providers for aliases registration

Valerie Peng valerie.peng at oracle.com
Wed May 6 03:18:18 UTC 2020


Hi Max,

Webrev has been updated, 
http://cr.openjdk.java.net/~valeriep/8242151/webrev.02/.

Major changes are:

- Moved oidTable caching from AlgorithmId class to ObjectIdentifier 
class. Made ObjectIdentifier constructor private and callers have to use 
the of(String) method which always check the oidTable cache before 
creating new instances. Some more files (src files and tests) are added 
to the webrev due to the private ObjectIdentifier constructor change.

- Arrays.asList() calls are now replaced with List.of() calls.

- KnownOIDs enum has been enhanced with registerName() method for 
ensuring that same standard name can have at most one enum mapping. 
Added the method stdName() instead of relying on toString(). Added 
aliases support to KnownOIDs enums. Note that external aliases are in 
SecurityProviderConstants class. The two non-oid BASE ones are removed 
and keytool/Main.java is updated.

- SecurityProviderConstants class will pick up the internal aliases and 
combine with external aliases and handle multiple oid enums in its 
store(...) method.

- Updated SunRsaSign provider to use the same naming convention (append 
the letter A) and fixed its KeyFactory and KeyPairGenerator to use the 
same oid as before. Also update providers outside of the java.base 
module in a similar fashion.

As for the comments below. Please find replies inline.

On 5/4/2020 6:24 PM, Weijun Wang wrote:
> Do you want to add OIDs in CurveDB into KnownOIDs as well?

Sure, will do in webrev.03.

Thanks,

Valerie

>
> Thanks,
> Max


More information about the security-dev mailing list