Asn1Real

ASN.1 REAL number. Mind possible loss of precision compared to Kotlin's built-in types. This type is irrelevant for PKI applications, but required for generic ASN.1 serialization

Inheritors

Types

Link copied to clipboard
Link copied to clipboard
data class Finite : Asn1Real
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
object Zero : Asn1Real

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 REAL

Link copied to clipboard
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 fun toDouble(): Double

Converts this Asn1Real to a Double. Beware of possible loss of precision!

Link copied to clipboard
open fun toFloat(): Float

Converts this Asn1Real to a Float. Beware of probable loss of precision!

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