RFR: 8252523: Add ASN1 Formatter to work with HexPrinter [v2]
Roger Riggs
rriggs at openjdk.java.net
Wed Sep 23 18:51:22 UTC 2020
On Mon, 21 Sep 2020 00:19:53 GMT, Weijun Wang <weijun at openjdk.org> wrote:
>> Roger Riggs has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Small cleanups to javadoc and code
>
> test/lib/jdk/test/lib/hexdump/ASN1Formatter.java line 228:
>
>> 226: break;
>> 227:
>> 228: case TAG_OctetString:
>
> I'd rather print nothing for OCTET STRING. My understanding of it is opaque octets and not meant to be printable.
Octet Strings can may contain printable strings and it is useful to print them.
A heuristic is used to determine if they are printable and the length is limited to avoid spewing garbage.
> test/lib/jdk/test/lib/hexdump/ASN1Formatter.java line 362:
>
>> 360: switch (tag & 0xc0) {
>> 361: case TAG_APPLICATION:
>> 362: return "APPLICATION " + cons + (tag & 0x1f);
>
> I am not sure how important it is to print out "cons". Also, the tag here is usually shown as "[1]" in ASN.1
> definition. Of course, if you choose this style, you might want to avoid using brackets for length.
It provides a more complete info on the tag even though the application may not have publicly defined its values.
-------------
PR: https://git.openjdk.java.net/jdk/pull/268
More information about the core-libs-dev
mailing list