decodeFromAsn1ContentBytes

Decodes a Asn1Integer from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 INTEGER

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.


Decodes a signed Int from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 INTEGER

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

if the byte array is out of bounds for a signed int


Decodes a signed Long from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 INTEGER

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

if the byte array is out of bounds for a signed long


Decodes a UInt from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 INTEGER

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

if the byte array is out of bounds for an unsigned int


Decodes a ULong from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 INTEGER

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

if the byte array is out of bounds for an unsigned long


Decodes a Boolean from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 BOOLEAN


Decodes a String from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 STRING (any kind) The bytes are always decoded as UTF-8, via the standard library's ByteArray.decodeToString