Properties

Link copied to clipboard
open override val descriptor: SerialDescriptor
Link copied to clipboard
open override val leadingTags: Set<Asn1Element.Tag>

Leading ASN.1 tags this serializer can decode/encode.

Functions

Link copied to clipboard
fun decodeFromAsn1ContentBytes(bytes: ByteArray, lenient: Boolean = false): Asn1Real

Decodes a Asn1Real from bytes assuming the same encoding as the Asn1Primitive.content property of an Asn1Primitive containing an ASN.1 REAL

Link copied to clipboard
fun <A : Asn1Element, T : Asn1Encodable<A>> Asn1Decodable<A, T>.decodeFromDer(src: ByteArray, limit: Long = src.size.toLong(), assertTag: Asn1Element.Tag? = null): T

Convenience method, directly DER-decoding a byte array to T

fun <A : Asn1Element, T : Asn1Encodable<A>> Asn1Decodable<A, T>.decodeFromDer(src: Source<*>, limit: Long?, assertTag: Asn1Element.Tag? = null): T

Decodes src as DER using this Asn1Decodable.

Link copied to clipboard
fun <A : Asn1Element, T : Asn1Encodable<A>> Asn1Decodable<A, T>.decodeFromDerOrNull(src: ByteArray, limit: Long = src.size.toLong(), assertTag: Asn1Element.Tag? = null): T?

Exception-free version of decodeFromDer

Link copied to clipboard
open override fun decodeFromTlv(src: Asn1Primitive, assertTag: Asn1Element.Tag? = null): Asn1Real

Processes an A, parsing it into an instance of T

Link copied to clipboard
fun <A : Asn1Element, T : Asn1Encodable<A>> Asn1Decodable<A, T>.decodeFromTlvOrNull(src: A, assertTag: Asn1Element.Tag? = null): T?

Exception-free version of Asn1Decodable.decodeFromTlv

Link copied to clipboard
open override fun deserialize(decoder: Decoder): Asn1Real

Decodes one ASN.1-backed value via DER bytes.

Link copied to clipboard
open override fun doDecode(src: Asn1Primitive): Asn1Real

Actual element-specific decoding function. By default, this is invoked after verifyTag

Link copied to clipboard
operator fun invoke(number: Double): Asn1Real

Converts a Double into an ASN.1 REAL. Beware of the fact that ASN.1 REAL zero knows no sign!

inline operator fun invoke(number: Float): Asn1Real

Converts a Float into an ASN.1 REAL.

operator fun invoke(mantissa: Asn1Integer, exponent: Long): Asn1Real
Link copied to clipboard

Convenience method to directly parse a HEX-string representation of DER-encoded data. Ignores and strips all whitespace.

Link copied to clipboard
open override fun serialize(encoder: Encoder, value: Asn1Real)

Encodes one ASN.1-backed value via DER bytes.

Link copied to clipboard
open override fun verifyTag(src: Asn1Primitive, assertTag: Asn1Element.Tag?)

Specify assertTag for verifying implicitly tagged elements' tags (and better not override this function).