Package-level declarations
Types
Class Providing a DSL for creating arbitrary ASN.1 structures. You will almost certainly never use it directly, but rather use it as follows:
Properties
Functions
Transforms this Asn1Primitive' into an Asn1BitString, assuming it was encoded as BIT STRING
transforms this Asn1Primitive into an Asn1String subtype based on its tag
Generic decoding function. Verifies that this Asn1Primitive's tag matches assertTag and transforms its content as per transform
Decodes an unsigned Asn1Integer from bytes using varint encoding as used within ASN.1: groups of seven bits are encoded into a byte, while the highest bit indicates if more bytes are to come. Trailing bytes are ignored.
Decodes an ASN.1 unsigned varint to a Asn1Integer, copying all bytes from the source into a ByteArray.
Decodes an UInt from bytes using varint encoding as used within ASN.1: groups of seven bits are encoded into a byte, while the highest bit indicates if more bytes are to come. Trailing bytes are ignored.
Decodes an ULong from bytes using varint encoding as used within ASN.1: groups of seven bits are encoded into a byte, while the highest bit indicates if more bytes are to come. Trailing bytes are ignored.
Decodes a Asn1Integer from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 INTEGER
Decodes a Boolean from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 BOOLEAN
Decodes a signed Int from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 INTEGER
Decodes a signed Long from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 INTEGER
Decodes a String from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 STRING (any kind)
Decodes a UInt from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 INTEGER
Decodes a ULong from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 INTEGER
Decodes an Instant from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 GENERALIZED TIME
Exception-free version of decode
Decode the Asn1Primitive as a Asn1Integer
Exception-free version of decodeToAsn1Integer
decodes this Asn1Primitive's content into an Boolean. assertTag defaults to Asn1Element.Tag.BOOL, but can be overridden (for implicitly tagged booleans, for example)
Exception-free version of decodeToBoolean
decodes this Asn1Primitive's content into an Instant if it is encoded as UTC TIME or GENERALIZED TIME
Exception-free version of decodeToInstant
decodes this Asn1Primitive's content into an Int. assertTag defaults to Asn1Element.Tag.INT, but can be overridden (for implicitly tagged integers, for example)
Exception-free version of decodeToInt
decodes this Asn1Primitive's content into a Long. assertTag defaults to Asn1Element.Tag.INT, but can be overridden (for implicitly tagged longs, for example)
Exception-free version of decodeToLong
Decodes this Asn1Primitive's content into a String.
Exception-free version of decodeToString
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)
Exception-free version of decodeToUInt
decodes this Asn1Primitive's content into an ULong. assertTag defaults to Asn1Element.Tag.INT, but can be overridden (for implicitly tagged unsigned longs, for example)
Exception-free version of decodeToULong
Decodes an Instant from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 UTC TIME
Encode as a four-byte array
Encode as an eight-byte array
Prepends 0x00 to this ByteArray for encoding it into a BIT STRING. No inverse function is implemented, since .drop(1)
does the job.
Produces a BIT STRING as Asn1Primitive
Encodes this number into a ByteArray using the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 INTEGER
Encodes this boolean into a ByteArray using the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 BOOLEAN
Produces a GENERALIZED TIME as Asn1Primitive
Produces an OCTET STRING as Asn1Primitive
Produces an INTEGER as Asn1Primitive
Produces a BOOLEAN as Asn1Primitive
Produces an ASN.1 UTF8 STRING as Asn1Primitive
Produces a UTC TIME as Asn1Primitive
Parses the provided input into a single Asn1Element. Consumes all Bytes and throws if more than one Asn.1 Structure was found or trailing bytes were detected
Tries to parse the input into a list of Asn1Elements. Consumes all Bytes and throws if an invalid ASN.1 Structure is found at any point.
Convenience wrapper around parseFirst, taking a ByteArray as source.
Decodes a single Asn1Element from this source.
Reads all parsable ASN.1 elements from this source.
decodes this Asn1Primitive to null (i.e. verifies the tag to be BERTags.ASN1_NULL and the content to be empty
Name seems odd, but this is just an exception-free version of readNull
Encodes this number using varint encoding as used within ASN.1: groups of seven bits are encoded into a byte, while the highest bit indicates if more bytes are to come
Encodes this number using unsigned VarInt encoding as used within ASN.1: Groups of seven bits are encoded into a byte, while the highest bit indicates if more bytes are to come.
Encodes a signed Int to a minimum-size twos-complement byte array
Encodes a signed Long to a minimum-size twos-complement byte array
Encodes an unsigned Int to a minimum-size twos-complement byte array
Encodes an unsigned Long to a minimum-size twos-complement byte array
Encodes an unsigned Int to a minimum-size unsigned byte array
Encodes an unsigned Long to a minimum-size unsigned byte array
Encodes this number using varint encoding as used within ASN.1: groups of seven bits are encoded into a byte, while the highest bit indicates if more bytes are to come
Encodes a positive Long to a minimum-size unsigned byte array, omitting the leading zero
Writes a signed long using twos-complement encoding using the fewest bytes required
Encodes an unsigned Int to a minimum-size twos-complement byte array
Encodes an unsigned Long to a minimum-size twos-complement byte array