RFR: 8298420: PEM API: Implementation (Preview) [v14]
Anthony Scarpino
ascarpino at openjdk.org
Sat May 10 02:15:15 UTC 2025
On Thu, 1 May 2025 17:47:03 GMT, Weijun Wang <weijun at openjdk.org> wrote:
>> I see your point now, but `leadingData` is a byte array. If an app wrote the `leadingData` in a `ByteArrayInputStream`, followed by the PEM text, it would not be the same data written as the newline would be gone. Correct?
>
> Why would it be gone? It's a 0x10 at the end of the byte array.
So I wouldn't want to remove or parse any of the `leadingData` as it could be binary data in front of them PEM.
Since this is a byte[] from an InputStream, I think there is an expectation that every byte will be there. If it was a Reader, it maybe different. Also if the app is reading `leadingData` by converting into a String, I think that trailing newline is removed.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17543#discussion_r2082454735
More information about the security-dev
mailing list