Asn1String

@Serializable
sealed class Asn1String : Asn1Encodable<Asn1Primitive> (source)

ASN.! String class used as wrapper do discriminate between different ASN.1 string types

Inheritors

Types

Link copied to clipboard
@Serializable
@SerialName(value = "BMPString")
class BMP(val value: String) : Asn1String

BMP STRING (no checks)

Link copied to clipboard
Link copied to clipboard
@Serializable
@SerialName(value = "IA5String")
class IA5(val value: String) : Asn1String

IA5 STRING (no checks)

Link copied to clipboard
@Serializable
@SerialName(value = "NumericString")
class Numeric constructor(val value: String) : Asn1String

NUMERIC STRING (checked)

Link copied to clipboard
@Serializable
@SerialName(value = "PrintableString")
class Printable constructor(val value: String) : Asn1String

PRINTABLE STRING (checked)

Link copied to clipboard
@Serializable
@SerialName(value = "TeletexString")
class Teletex(val value: String) : Asn1String

TELETEX STRING (no checks)

Link copied to clipboard
@Serializable
@SerialName(value = "UniversalString")
class Universal(val value: String) : Asn1String

UNIVERSAL STRING (unchecked)

Link copied to clipboard
@Serializable
@SerialName(value = "UTF8String")
class UTF8(val value: String) : Asn1String

UTF8 STRING (verbatim String)

Link copied to clipboard
@Serializable
@SerialName(value = "VisibleString")
class Visible(val value: String) : Asn1String

VISIBLE STRING (no checks)

Properties

Link copied to clipboard
abstract val tag: ULong
Link copied to clipboard
abstract val value: String

Functions

Link copied to clipboard

Convenience function to directly get the DER-encoded representation of the implementing object

Link copied to clipboard

Exception-free version of encodeToDer

Link copied to clipboard
open fun encodeToDerSafe(): KmmResult<ByteArray>

Safe version of encodeToDer, wrapping the result into a KmmResult

Link copied to clipboard
open override fun encodeToTlv(): Asn1Primitive

Encodes the implementing object into an A

Link copied to clipboard

Exception-free version of encodeToTlv

Link copied to clipboard
open fun encodeToTlvSafe(): KmmResult<Asn1Primitive>

Safe version of encodeToTlv, wrapping the result into a KmmResult

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

Creates a new implicitly tagged ASN.1 Element from this ASN.1 Element. NOTE: The TagClass of the provided tag will be used! If you want the result to have TagClass.CONTEXT_SPECIFIC, also invoke tag withClass TagClass.CONTEXT_SPECIFIC!. If a CONSTRUCTED Tag is applied to an ASN.1 Primitive, the CONSTRUCTED bit is overridden and set to zero

Creates a new implicitly tagged ASN.1 Element from this ASN.1 Structure. If the provided template's tagClass is not set, the class of the resulting structure defaults to TagClass.CONTEXT_SPECIFIC. If a CONSTRUCTED Tag is applied to an ASN.1 Primitive, the CONSTRUCTED bit is overridden and set to zero

open infix fun withImplicitTag(tagValue: ULong): Asn1Element

Creates a new implicitly tagged ASN.1 Element from this ASN.1 Element. Sets the class of the resulting structure to TagClass.CONTEXT_SPECIFIC