Asn1AbstractBitString

ASN.1 BIT STRING. When serialized to a non-DER format, uses: base64Strict(content octets). Different encoding rules apply for general bit strings (Asn1BitString), and named bit lists (Asn1NamedBitList).

Inheritors

Properties

Link copied to clipboard

A copy of the bytes containing the BitString. Within each byte, bit 0 is the most significant. This is normalized to comply with the type's canonical encoding (per DER), regardless of what the wire bytes were.

Link copied to clipboard
abstract val numPaddingBits: Int

The number of trailing meaningless zero padding bits at the end of bitCarryingBytes. Always in 0..7.

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 override fun encodeToTlv(): Asn1Primitive

Encodes the implementing object into an A

Link copied to clipboard
Link copied to clipboard
abstract operator fun get(bitIndex: Long): Boolean

Retrieves a single bit from the BIT STRING. Bits are addressed as per ASN.1, with index 0 being the most significant bit.

Link copied to clipboard

shorthand for Asn1Element.prettyPrint, hence, a call to this function encodes this encodable to an Asn1Element, holds it in memory, pretty prints it, and discards it. This characteristic may be relevant in memory-constrained environments.

Link copied to clipboard
fun Asn1Encodable<*>.toDerHexString(lineLen: Int? = null): String
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