Asn1PemDecodable
interface Asn1PemDecodable<A : Asn1Element, T : Asn1Encodable<A>> : PemDecodable<T> , Asn1Decodable<A, T> , PemLabelSpec<T> (source)
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
Functions
Link copied to clipboard
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
fun <A : Asn1Element, T : Asn1Encodable<A>> Asn1PemDecodable<A, T>.decodeFromDerWithPemHeaders(pemHeaders: Iterable<PemHeader>, der: ByteArray): T
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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
Link copied to clipboard
Link copied to clipboard
fun <A : Asn1Element, T : Asn1Encodable<A>> Asn1Decodable<A, T>.parseFromDerHexString(derEncoded: String): T
fun <A : Asn1Element, T : Asn1Encodable<A>> Asn1Decodable<A, T>.parseFromDerHexString(derEncoded: String, limit: Long): T
Convenience method to directly parse a HEX-string representation of DER-encoded data. Ignores and strips all whitespace.
Link copied to clipboard
Link copied to clipboard
Specify assertTag for verifying implicitly tagged elements' tags (and better not override this function).