On Fri, 12 Sep 2025 23:32:43 GMT, Weijun Wang <[email protected]> wrote:
>> src/java.base/share/classes/javax/crypto/spec/HPKEParameterSpec.java line
>> 286:
>>
>>> 284: * @throws IllegalArgumentException if {@code info} is empty.
>>> 285: */
>>> 286: public HPKEParameterSpec withInfo(byte[] info) {
>>
>> After reading your example at the class javadoc level, it left me with the
>> impression that `withInfo()` would be used with `String`. Does it make
>> sense to have a `withInfo(String)` method? Or maybe the example less
>> String-specific?
>
> Oh, I just want to be self-contained in the example and `new byte[10]` seems
> too trivial. Actually, it's very likely not a string. For example, in TLS
> Encrypted Client Hello, it's `"tls ech" || 0x00 || ECHConfig`. I don't think
> it's worth adding an overloaded `withInfo(String)`. It's similar to the
> `info` in HKDF-Expand.
I'll change the line to `.withInfo(HexFormat.of().parseHex("010203040506"))`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18411#discussion_r2352602774