parseAll

fun Asn1Element.Companion.parseAll(source: Source, limit: Long): List<Asn1Element>(source)

Parses all ASN.1 elements from the given source within the specified limit.

Return

A list of parsed ASN.1 elements.

Parameters

source

The input source from which the ASN.1 elements will be parsed.

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

if the input does not parse or if it exceeds the specified limit. This includes length encoding indicating a length greater than limit, even if this is malformed and exceeds the number of bytes left in the source.