Asn1BitString

A general ASN.1 BIT STRING. It has a concrete size (sizeBits/sizeBytes), and can be indexed accordingly.

Types

Link copied to clipboard

Properties

Link copied to clipboard
open override val bitCarryingBytes: ByteArray

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

The available indices into the BIT STRING.

Link copied to clipboard
open override val numPaddingBits: Int

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

Link copied to clipboard

The size of the BIT STRING in bits.

Link copied to clipboard

The size of the BIT STRING in bytes.

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
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open operator override 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
open override fun hashCode(): Int
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
open override fun toString(): 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