CborWriter

Writes CBOR in preferred serialization (RFC 8949 §4.1): shortest argument encoding and definite lengths only, so the output is deterministic. Calls chain:

val info = CborWriter()
.writeArrayHeader(3)
.writeBytes(senderId).writeInt(10).writeText("Key")
.toByteArray()

The writer does not check that headers are followed by the right number of items; CborReader round-trips in the tests guard the protocol code that uses it.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val size: Int

Functions

Link copied to clipboard
Link copied to clipboard

Appends value and, recursively, its content.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Appends bytes that already are one or more encoded CBOR items, such as a credential CRED_x.

Link copied to clipboard
fun writeInt(value: Int): CborWriter
fun writeInt(value: Long): CborWriter
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard