getParams() for XECKey returns nonsense

Anders Rundgren anders.rundgren.net at gmail.com
Tue Sep 8 18:42:13 UTC 2020


On 2020-09-08 19:29, Anthony Scarpino wrote:
> On 8/30/20 9:51 AM, Anders Rundgren wrote:
>> Hi,
>> This applies to JDK 11.
>>
>> https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/security/interfaces/XECKey.html
>>
>> what is the value of "AlgorithmParameterSpec"?
>>
>> In JDK 15 the new EdECKey has gotten a more logical solution:
>> https://download.java.net/java/early_access/jdk15/docs/api/java.base/java/security/interfaces/EdECKey.html
>>
>>
>> thanx,
>> Anders
>>
>>
>>
> 
> The return type for XECKey.getParams() was trying to be more generic, probably too generic.  

I guessed that.  Don't you have the same problem with EdECKey?


> NamedParameterSpec implements AlgorithParameterSpec.

Right, this is clear by looking at the API.


> The implementationf or XECKey returns a NamedParameterSpec.

Here is gets a bit slippery (at least compared to the solution for EdECKey) because this is 1) Undocumented 2) Oracle-provider-specific, both which pretty much nullifies the value of the public interface.

I may (surely) be wrong but changing the API to return NamedParameterSpec should not break any existing code based on the Oracle provider.

Thanx,
Anders

> 
> Tony
> 




More information about the security-dev mailing list