parse

Parses the provided source into a single Asn1Element. Consumes all bytes and throws if more than one ASN.1 structure was found or trailing bytes were detected.

Return

the parsed Asn1Element

Parameters

limit

the maximum allowed total number of encoded DER bytes to consume. This limit is enforced before reading or peeking from the underlying source.

Throws

on invalid input or if more than a single root structure was contained in the source