Asn1Decodable

Interface providing convenience methods to decode from ASN.1. Especially useful when companion objects of classes implementing Asn1Encodable implement it.

Inheritors

Functions

Link copied to clipboard
open fun decodeFromDer(src: ByteArray, assertTag: Asn1Element.Tag? = null): T

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

Link copied to clipboard
open fun decodeFromDerOrNull(src: ByteArray, assertTag: Asn1Element.Tag? = null): T?

Exception-free version of decodeFromDer

Link copied to clipboard
open fun decodeFromDerSafe(src: ByteArray, assertTag: Asn1Element.Tag? = null): KmmResult<T>

Safe version of decodeFromDer, wrapping the result into a KmmResult

Link copied to clipboard
open fun decodeFromTlv(src: A, assertTag: Asn1Element.Tag? = null): T

Processes an A, parsing it into an instance of T

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

Exception-free version of decodeFromTlv

Link copied to clipboard
open fun decodeFromTlvSafe(src: A, assertTag: Asn1Element.Tag? = null): KmmResult<T>

Safe version of decodeFromTlv, wrapping the result into a KmmResult

Link copied to clipboard
abstract fun doDecode(src: A): T

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

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

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