Asn1

object Asn1(source)

Namespace object for ASN.1 builder DSL functions and utility functions for creating ASN.1 primitives

Functions

Link copied to clipboard

Transforms the passed BitSet as BIT STRING Asn1Primitive to this ASN.1 structure. Left-Aligned and right-padded (see Asn1BitString)

Adds the passed bytes as BIT STRING Asn1Primitive to this ASN.1 structure

Link copied to clipboard

Adds a BOOL Asn1Primitive to this ASN.1 structure

Link copied to clipboard
fun GeneralizedTime(value: Instant): Asn1Primitive

Adds the passed instant as GENERALIZED TIME Asn1Primitive to this ASN.1 structure

Link copied to clipboard
fun Int(value: Int): Asn1Primitive

Adds an INTEGER Asn1Primitive to this ASN.1 structure

Link copied to clipboard
fun Long(value: Long): Asn1Primitive

Adds an INTEGER Asn1Primitive to this ASN.1 structure

Link copied to clipboard

Adds a NULL Asn1Primitive to this ASN.1 structure

Link copied to clipboard

Adds the passed bytes as OCTET STRING Asn1Element to this ASN.1 structure

Link copied to clipboard

OCTET STRING builder. The result of init is encapsulated into an ASN.1 OCTET STRING and then added to this ASN.1 structure

Link copied to clipboard

Adds the passed string as PRINTABLE STRING Asn1Primitive to this ASN.1 structure

Link copied to clipboard

Creates a new SEQUENCE as Asn1Sequence. Use as follows:

Link copied to clipboard

Exception-free version of Sequence

Link copied to clipboard
fun SequenceSafe(root: Asn1TreeBuilder.() -> Unit): KmmResult<Asn1Sequence>

Safe version of Sequence, wrapping the result into a KmmResult

Link copied to clipboard
fun Set(root: Asn1TreeBuilder.() -> Unit): Asn1Set

Creates a new SET as Asn1Set. Elements are sorted by tag. Use as follows:

Link copied to clipboard
fun SetOf(root: Asn1TreeBuilder.() -> Unit): Asn1Set

Creates a new SET OF as Asn1Set. Tags of all added elements need to be the same. Elements are sorted by encoded value Use as follows:

Link copied to clipboard

Exception-free version of SetOf

Link copied to clipboard
fun SetOfSafe(root: Asn1TreeBuilder.() -> Unit): KmmResult<Asn1Set>

Safe version of SetOf, wrapping the result into a KmmResult

Link copied to clipboard

Exception-free version of Set

Link copied to clipboard
fun SetSafe(root: Asn1TreeBuilder.() -> Unit): KmmResult<Asn1Set>

Safe version of Set, wrapping the result into a KmmResult

Link copied to clipboard
fun Tagged(tag: UByte, root: Asn1TreeBuilder.() -> Unit): Asn1Tagged

Creates a new EXPLICITLY TAGGED ASN.1 structure as Asn1Tagged using tag.

Link copied to clipboard

Exception-free version of Tagged

Link copied to clipboard
fun TaggedSafe(tag: UByte, root: Asn1TreeBuilder.() -> Unit): KmmResult<Asn1Tagged>

Safe version on Tagged, wrapping the result into a KmmResult

Link copied to clipboard
fun UtcTime(value: Instant): Asn1Primitive

Adds the passed instant as UTC TIME Asn1Primitive to this ASN.1 structure

Link copied to clipboard

Adds the passed string as UTF8 STRING Asn1Primitive to this ASN.1 structure