RFR: 8279801: EC KeyFactory and KeyPairGenerator do not have aliases for OID format

2022-01-11 Thread Weijun Wang
Add OID aliases for the 2 service. This makes sure KeyFactory can be created 
and read an encoded key without knowing what the OID in the encoding is for.

-

Commit messages:
 - 8279801: EC KeyFactory and KeyPairGenerator do not have aliases for OID 
format

Changes: https://git.openjdk.java.net/jdk/pull/7036/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7036&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8279801
  Stats: 52 lines in 2 files changed: 45 ins; 2 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7036.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7036/head:pull/7036

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


Re: RFR: 8279801: EC KeyFactory and KeyPairGenerator do not have aliases for OID format

2022-01-11 Thread Xue-Lei Andrew Fan
On Tue, 11 Jan 2022 20:34:59 GMT, Weijun Wang  wrote:

> Add OID aliases for the 2 service. This makes sure KeyFactory can be created 
> and read an encoded key without knowing what the OID in the encoding is for.

It is not obvious about the description "Add OID aliases for the 2 service", 
but I think I got the idea.  Looks good to me.

-

Marked as reviewed by xuelei (Reviewer).

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


Re: RFR: 8279801: EC KeyFactory and KeyPairGenerator do not have aliases for OID format

2022-01-12 Thread Valerie Peng
On Tue, 11 Jan 2022 20:34:59 GMT, Weijun Wang  wrote:

> Add OID aliases for the 2 service. This makes sure KeyFactory can be created 
> and read an encoded key without knowing what the OID in the encoding is for.

src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java line 322:

> 320:  */
> 321: putService(new ProviderServiceA(this, "KeyPairGenerator",
> 322: "EC", "sun.security.ec.ECKeyPairGenerator", ATTRS));

How about the EllipticCurve alias? Are we dropping it?

-

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


Re: RFR: 8279801: EC KeyFactory and KeyPairGenerator do not have aliases for OID format

2022-01-12 Thread Valerie Peng
On Wed, 12 Jan 2022 21:17:41 GMT, Valerie Peng  wrote:

>> Add OID aliases for the 2 service. This makes sure KeyFactory can be created 
>> and read an encoded key without knowing what the OID in the encoding is for.
>
> src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java line 322:
> 
>> 320:  */
>> 321: putService(new ProviderServiceA(this, "KeyPairGenerator",
>> 322: "EC", "sun.security.ec.ECKeyPairGenerator", ATTRS));
> 
> How about the EllipticCurve alias? Are we dropping it?

Hmm, I searched various security docs such as SunEC provider and standard 
names, there is no mentioning of EllipticCurve alias. So probably ok to drop it.

-

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


Re: RFR: 8279801: EC KeyFactory and KeyPairGenerator do not have aliases for OID format

2022-01-12 Thread Valerie Peng
On Tue, 11 Jan 2022 20:34:59 GMT, Weijun Wang  wrote:

> Add OID aliases for the 2 service. This makes sure KeyFactory can be created 
> and read an encoded key without knowing what the OID in the encoding is for.

Marked as reviewed by valeriep (Reviewer).

-

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


Re: RFR: 8279801: EC KeyFactory and KeyPairGenerator do not have aliases for OID format

2022-01-12 Thread Weijun Wang
On Wed, 12 Jan 2022 21:22:34 GMT, Valerie Peng  wrote:

>> src/jdk.crypto.ec/share/classes/sun/security/ec/SunEC.java line 322:
>> 
>>> 320:  */
>>> 321: putService(new ProviderServiceA(this, "KeyPairGenerator",
>>> 322: "EC", "sun.security.ec.ECKeyPairGenerator", ATTRS));
>> 
>> How about the EllipticCurve alias? Are we dropping it?
>
> Hmm, I searched various security docs such as SunEC provider and standard 
> names, there is no mentioning of EllipticCurve alias. So probably ok to drop 
> it.

Er, maybe I can add it into KnownOIDs? `EC("1.2.840.10045.2.1", "EC", 
"EllipticCurve")`.

-

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