Currently, the parser is eager to consume all bytes, when trying to parse an ASN.1 Structure.
This makes little sense, because only a single toplevel structure is allowed. If, for example, some input (which can be perfectly legal in a couple of use cases) starts with a valid ASN.1 structure, followed by other data (possibly even additional valid ASN.1 structures), parsing will fail.
Hence, the toplevel Asn1Element.parse and Asn1Element.decodeFromDerHexString should only try to parse the very first ASN.1 Structure and also return all non-parsed trailing bytes.
Currently, the parser is eager to consume all bytes, when trying to parse an ASN.1 Structure. This makes little sense, because only a single toplevel structure is allowed. If, for example, some input (which can be perfectly legal in a couple of use cases) starts with a valid ASN.1 structure, followed by other data (possibly even additional valid ASN.1 structures), parsing will fail.
Hence, the toplevel
Asn1Element.parse
andAsn1Element.decodeFromDerHexString
should only try to parse the very first ASN.1 Structure and also return all non-parsed trailing bytes.