RFR: 8298420: PEM API: Implementation (Preview) [v2]
Anthony Scarpino
ascarpino at openjdk.org
Mon Jul 29 21:01:33 UTC 2024
On Thu, 25 Jul 2024 20:18:20 GMT, Weijun Wang <weijun at openjdk.org> wrote:
>> Anthony Scarpino has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - bad test check
>> - internal PEMRecord optimization
>
> src/java.base/share/classes/sun/security/util/DerInputStream.java line 425:
>
>> 423: public Optional<DerValue> getOptionalConstructed(int n, byte tag)
>> 424: throws IOException {
>> 425: if (checkNextTag(t -> (t & 0x0c0) == 0x080 && (t & 0x020) == 0x020 &&
>
> is it possible to combine this with `getOptionalImplicitContextSpecific`? If I understand correctly, the CONSTRUCTED flag should be retained in the encoding even if it's IMPLICIT. Therefore, if `tag` has 0x20 then `t` should also have, vice versa.
An upcoming change removes this method.
> src/java.base/share/classes/sun/security/util/Pem.java line 47:
>
>> 45: * Public Key PEM header & footer
>> 46: */
>> 47: public static final byte[] PUBHEADER = "-----BEGIN PUBLIC KEY-----"
>
> Maybe add some underscores to make the names more readable?
Outdated with code change
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17543#discussion_r1695928651
PR Review Comment: https://git.openjdk.org/jdk/pull/17543#discussion_r1695921966
More information about the security-dev
mailing list