RFR: 8298420: PEM API: Implementation (Preview) [v14]
Weijun Wang
weijun at openjdk.org
Mon Apr 28 16:30:54 UTC 2025
On Sun, 27 Apr 2025 22:20:32 GMT, Anthony Scarpino <ascarpino at openjdk.org> wrote:
>> src/java.base/share/classes/java/security/PEMEncoder.java line 300:
>>
>>> 298: // If `key` is non-null, this is an encoder ready to encrypt.
>>> 299: if (key != null) {
>>> 300: if (privateBytes == null || publicBytes != null) {
>>
>> `publicBytes` cannot be null here. You rejected both being null at the beginning of this method.
>
> The check at the top is AND, while this is OR.
You're right.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17543#discussion_r2064051233
More information about the security-dev
mailing list