Package-level declarations

Types

Link copied to clipboard
interface Buffer : Source<Buffer> , Sink
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class ByteArraySource(data: ByteArray, index: Int = 0, size: Int = data.size) : Source<ByteArraySink>
Link copied to clipboard
interface Sink
Link copied to clipboard
interface Source<S : Sink>

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Decodes an ASN.1 unsigned varint to a Asn1Integer, copying all bytes from the source into a ByteArray.

Link copied to clipboard

Decodes an ASN.1 unsigned varint to an UInt, copying all bytes from the source into a ByteArray.

Link copied to clipboard

Decodes an ASN.1 unsigned varint to an ULong, copying all bytes from the source into a ByteArray.

Link copied to clipboard
fun <A : Asn1Element, T : Asn1Encodable<A>> Asn1Decodable<A, T>.decodeFromDer(src: Source<*>, limit: Long?, assertTag: Asn1Element.Tag? = null): T

Decodes src as DER using this Asn1Decodable.

Link copied to clipboard
Link copied to clipboard

Parses the provided source into a single Asn1Element.

Link copied to clipboard

Parses all ASN.1 elements from source.

Link copied to clipboard

Parses the first ASN.1 element from source.

Link copied to clipboard

Decodes a single Asn1Element from this source.

Link copied to clipboard
Link copied to clipboard

Reads all parsable ASN.1 elements from this source.

Link copied to clipboard
fun Source<*>.readTwosComplementInt(nBytes: Int, lenient: Boolean): Int

Consumes exactly nBytes from this source and interprets it as a signed Int

Link copied to clipboard
fun Source<*>.readTwosComplementLong(nBytes: Int, lenient: Boolean): Long

Consumes exactly nBytes from this source and interprets it as a Long.

Link copied to clipboard
fun Source<*>.readTwosComplementUInt(nBytes: Int, lenient: Boolean): UInt

Consumes exactly nBytes remaining data from this source and interprets it as a UInt

Link copied to clipboard
fun Source<*>.readTwosComplementULong(nBytes: Int, lenient: Boolean): ULong

Consumes exactly nBytes from this source and interprets it as a signed ULong.

Link copied to clipboard
inline fun Source<*>.readUByte(): UByte
Link copied to clipboard

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

Link copied to clipboard

Encodes a positive Long to a minimum-size unsigned byte array, omitting the leading zero

Link copied to clipboard

Writes a signed long using twos-complement encoding using the fewest bytes required

Link copied to clipboard

Encodes an unsigned Int to a minimum-size twos-complement byte array

Link copied to clipboard

Encodes an unsigned Long to a minimum-size twos-complement byte array

Link copied to clipboard
inline fun Sink.writeUByte(uByte: UByte)