Asn1BitString

ASN.1 BIT STRING

Constructors

Link copied to clipboard
constructor(source: BitSet)

Creates an ASN.1 BIT STRING from the provided bitSet. The transformation to rawBytes and the calculation of numPaddingBits happens immediately in the constructor. Hence, modifications to the source BitSet have no effect on the resulting Asn1BitString.

Types

Link copied to clipboard

Properties

Link copied to clipboard

Number of bits needed to pad the bit string to a byte boundary

Link copied to clipboard

The raw bytes containing the bit string. The bits contained in rawBytes are laid out, as printed when calling BitSet.toBitString, right-padded with numPaddingBits many zero bits to the last byte boundary.

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

Encodes the implementing object into an A

Link copied to clipboard

Exception-free version of encodeToTlv

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

Safe version of encodeToTlv, wrapping the result into a KmmResult

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Transforms rawBytes and wraps into a BitSet. The last numPaddingBits bits are ignored. This is a deep copy and mirrors the bits in every byte to match the native bitset layout where bit any byte indices run in opposite direction. Hence, modifications to the resulting bitset do not affect rawBytes