On Mon, 18 Mar 2024 14:02:20 GMT, Jan Lahoda <jlah...@openjdk.org> wrote:

>> Hello Jaikiran,
>> in jdk21 DHPPublicKey did have a 
>> [getParams()](https://github.com/openjdk/jdk21/blob/890adb6410dab4606a4f26a942aed02fb2f55387/src/java.base/share/classes/com/sun/crypto/provider/DHPublicKey.java#L244)
>>  method, so it is not new in jdk 22. It also existed [before 
>> that](https://github.com/openjdk/jdk11/blob/37115c8ea4aff13a8148ee2b8832b20888a5d880/src/java.base/share/classes/com/sun/crypto/provider/DHPublicKey.java#L252)
>> 
>> If you haven't looked at the other cases, I was about to group the changes 
>> related to the Key interfaces in a separate PR if that's fine. let me know 
>> what you think
>
> Hello,
> 
> While the override of `getParams` in `DHPublicKey` was added, the `getParams` 
> method has been inherited to `DHPublicKey` for a long time from `DHKey`. 
> E.g., I can take this:
> 
> import javax.crypto.interfaces.DHPublicKey;
> 
> public class DhkeyTest {
> 
>     public static void main(DHPublicKey key) {
>         System.err.println(key.getParams());
>     }
>     
> }
> 
> 
> and compile using JDK 8 without any compile-time errors. So, it would make 
> more sense to me to not add the `@since` for it.
> 
> I believe Nizar will separate the changes to the Key interfaces into a 
> separate PR, so we can discuss in more detail there.
> 
> Thanks!

Hello Jan, interesting. I hadn't noticed that 
`javax.crypto.interfaces.DHPublicKey` already was exposing `getParams()` in 
earlier versions because `javax.crypto.interfaces.DHPublicKey` extends from 
`javax.crypto.interfaces.DHKey` which has the `getParams()` method.

 > I believe Nizar will separate the changes to the Key interfaces into a 
 > separate PR, so we can discuss in more detail there.

That sounds fine to me.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18055#discussion_r1528641492

Reply via email to