Asn1Integer

@Serializable(with = Asn1IntegerSerializer::class)
sealed class Asn1Integer(source)

A very simple implementation of an ASN.1 variable-length integer. It is only good for reading from and writing to ASN.1 structures. It is not a BigInt, nor does it define any operations. It has a sign though, and supports twosComplement representation and converting fromTwosComplement. Hence, it directly interoperates with Kotlin MP BigNum and the JVM BigInteger.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Encodes this number into a ByteArray using the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 INTEGER

Link copied to clipboard
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
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
open override fun toString(): String
Link copied to clipboard
abstract fun twosComplement(): ByteArray