RFR: 8346129: Simplify EdDSA & XDH curve name usage

Anthony Scarpino ascarpino at openjdk.org
Fri Feb 21 20:33:54 UTC 2025


On Fri, 21 Feb 2025 20:10:33 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> They are already defined. I think you just want to add something like:
>> 
>> 
>> If (key.getAlgorithm().equals("ML-KEM") || key.getAlgorithm().equals("ML-DSA")) {
>>    return ((NamedParameterSpec) key.getParams()).getName();
>> }
>> 
>> 
>> Not urgent, but useful if one of these algorithms were to weaken or be broken for some reason.
>
> Or what about this?
> 
>         if (key instanceof AsymmetricKey ak) {
>             if (ak.getParams() instanceof NamedParameterSpec nps) {
>                 return nps.getName();
>             }
>         }
>         return key.getAlgorithm();
> 
> `AsymmetricKey` was introduced to make our lives easier.

I stayed away from that because this is likely being backported

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23647#discussion_r1966134944


More information about the security-dev mailing list