decodeToUInt

fun Asn1Primitive.decodeToUInt(assertTag: Asn1Element.Tag = Asn1Element.Tag.INT, lenient: Boolean = false): UInt(source)

decodes this Asn1Primitive's content into an UInt√. assertTag defaults to Asn1Element.Tag.INT, but can be overridden (for implicitly tagged unsigned integers, for example)

Parameters

lenient

Relaxes DER constraints, which are:

  • The content of the INTEGER type is not empty.

  • The INTEGER value is minimally encoded, verifying that:

    • Positive ints do not contain leading zero bytes unless necessary.

    • Negative ints do not use excessive sign extension bytes.

Throws

on invalid input