PemEncodable

Specialization of Asn1Encodable, able to produce PEM-encoded strings as per RFC 1421. Use in tandem with PemDecodable.

Properties

Link copied to clipboard

Encapsulation boundary string. Will be automatically fenced.

Functions

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
fun PemEncodable<*>.encodeToPEM(): KmmResult<String>

Encodes this PemEncodable into a PEM-encoded string

Link copied to clipboard
abstract fun encodeToTlv(): A

Encodes the implementing object into an A

Link copied to clipboard
open fun encodeToTlvOrNull(): A?

Exception-free version of encodeToTlv

Link copied to clipboard
open fun encodeToTlvSafe(): KmmResult<A>

Safe version of encodeToTlv, wrapping the result into a KmmResult

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