Closed leeopop closed 2 years ago
I agree that while showing the "potentially included (correctly decoded) child" (useful because many ASN.1 structures use OCTET STRINGs and BIT STRINGs to actually embed more ASN.1 content), the "value" of the base node should be the complete content, not only the child's content, which is the correct value if and only if the parent has the "constructed" bit.
PS: more exactly this only happens if it begins with 041E
or, rather, if the content is a valid BER content. You can check that 041D
and 041F
both don't show the encapsulated child.
Thank you for your super fast response! I was extracting hash value of a TSInfo document and this rarely happened when the hash starts with specific values.
I had a workaround solution that if an entry is surely represents a hash value, I extract the raw bytes and skip the header values.
Anyway, the content()
representation of this library is very useful to deal with ASN.1 documents which is not as famous as X.509.
Thanks again to your fast response and contributing this library to the community!
Definition
When an octet string's first word starts with '04', the parent octet string becomes the same value to its child.
Example
Screenshots