Package-level declarations
Types
ASN.1 BIT STRING
ASN1 structure (i.e. containing child nodes) with custom tag
Interface providing convenience methods to decode from ASN.1. Especially useful when companion objects of classes implementing Asn1Encodable implement it.
Base ASN.1 data class. Can either be a primitive (holding a value), or a structure (holding other ASN.1 elements)
ASN.1 OCTET STRING 0x04 (BERTags.OCTET_STRING) containing an Asn1Element
Interface providing methods to encode to ASN.1
Explicit ASN.1 Tag. Can contain any number of children
A very simple implementation of an ASN.1 variable-length integer. It is only good for reading from and writing to ASN.1 structures. It is not a BigInt, nor does it define any operations. It has a sign though, and supports twosComplement representation and converting fromTwosComplement. Hence, it directly interoperates with Kotlin MP BigNum and the JVM BigInteger.
Interface describing an ASN.1 OCTET STRING.
ASN.1 primitive. Holds no children, but content under tag
ASN.1 OCTET STRING 0x04 (BERTags.OCTET_STRING) containing arbitrary bytes
ASN.1 SEQUENCE 0x30 (BERTags.SEQUENCE OR BERTags.CONSTRUCTED)
ASN.1 SET 0x31 (BERTags.SET OR BERTags.CONSTRUCTED)
ASN.1 SET OF 0x31 (BERTags.SET OR BERTags.CONSTRUCTED)
ASN.! String class used as wrapper do discriminate between different ASN.1 string types
ASN.1 structure. Contains no data itself, but holds zero or more children
ASN.1 TIME (required since GENERALIZED TIME and UTC TIME exist)
Pure Kotlin Bit Set created by throwing a bunch of extension functions at a MutableList<Byte>
. As a mental model: this BitSet grows from left to right, just like writing a text.
Adds oid to the implementing class
ASN.1 OBJECT IDENTIFIER featuring the most cursed encoding of numbers known to man, which probably surfaced due to an ungodly combination of madness, cruelty and a twisted sense of humour. Courtesy of what were most probably tormented souls to begin with.
Functions
asserts that this element's tag matches tag.
Asserts only the tag number, but neither class, nor CONSTRUCTED bit.
decodes this Asn1Primitive's content into an ObjectIdentifier
Runs block inside catching and encapsulates any thrown exception in an Asn1Exception unless it already is one
Returns all bits as they are accessible by the global bit index (i.e. after wrapping this ByteArray into a BitSet)
Directly moves the byte array to a buffer without copying. Thus, it keeps bytes managed by a Buffer accessible. The bytes may be overwritten through the Buffer or even recycled to be used by another buffer. Therefore, operating on these bytes after wrapping leads to undefined behaviour.