Asn1PemDecodable

Helper class for decoding simple PEM structures, where the payload is just the DER bytes. By default, does not allow PEM headers, matching the RFC 7468 structures. Override decodeFromTlvWithPemHeaders to customize this.

Properties

Link copied to clipboard
abstract val pemLabel: String

Functions

Link copied to clipboard
Link copied to clipboard

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

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

Exception-free version of decodeFromDer

Link copied to clipboard
Link copied to clipboard
open override fun decodeFromPemBlock(src: PemBlock): T
Link copied to clipboard
open fun decodeFromTlv(src: A, assertTag: Asn1Element.Tag?): T

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 fun decodeFromTlvWithPemHeaders(pemHeaders: Iterable<PemHeader>, tlv: A): T
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).