Asn1OctetString
ASN.1 OCTET STRING 0x04 (BERTags.OCTET_STRING) containing arbitrary bytes
May be an Asn1EncapsulatingOctetString if the contained bytes are valid ASN.1.
Inheritors
Properties
Length (as a plain Int to work with it in code) of the contained data. Guarded: throws Asn1Exception if contentLengthLong exceeds Int.MAX_VALUE (a >2 GiB aggregate) rather than silently overflowing. For such elements use contentLengthLong.
Length of the contained data as a Long. This is the overflow-safe source of truth; for a primitive it is the size of the held bytes, for a structure the sum of the encoded sizes of all child nodes.
DER-encoded representation of this ASN.1 element.
Total number of bytes required to represent this element when encoding to ASN.1. Guarded: throws Asn1Exception if overallLengthLong exceeds Int.MAX_VALUE. For such elements use overallLengthLong.
Total number of bytes required to represent this element when encoding to ASN.1, as a Long. Computed arithmetically from the (sentinel-cached) contentLengthLong — no lazy, no materialized length array — so the length post-order (Asn1Structure.contentLengthLong) can sum children without per-node lock/allocation.
Functions
Transforms this Asn1Primitive' into an Asn1BitString, assuming it was encoded as BIT STRING
Convenience function to cast this element to an Asn1EncapsulatingOctetString
Convenience function to cast this element to an Asn1ExplicitlyTagged
Convenience function to cast this element to an Asn1OctetString
Convenience function to cast this element to an Asn1Primitive
Convenience function to cast this element to an Asn1Sequence
Convenience function to cast this element to an Asn1SequenceOf
Convenience function to cast this element to an Asn1Structure
Generic decoding function. Verifies that this Asn1Primitive's tag matches assertTag and transforms its content as per transform
Exception-free version of decode
Decode the Asn1Primitive as an Asn1Integer
Exception-free version of decodeToAsn1Integer
Decode the Asn1Primitive as an Asn1Real
Exception-free version of decodeToAsn1Real
decodes this Asn1Primitive's content into a Asn1String.BMP. assertTag defaults to Asn1Element.Tag.STRING_BMP, but can be overridden (for implicitly tagged strings, for example)
decodes this Asn1Primitive's content into an Boolean. assertTag defaults to Asn1Element.Tag.BOOL, but can be overridden (for implicitly tagged booleans, for example)
Exception-free version of decodeToBoolean
Decode the Asn1Primitive as a Double. Beware of possible loss of precision!
Exception-free version of decodeToDouble. Beware of possible loss of precision!
decodes this Asn1Primitive's content into an enum Entry based on the decoded ordinal. assertTag defaults to Asn1Element.Tag.ENUM, but can be overridden (for implicitly tagged enums, for example).
decodes this Asn1Primitive's content into an enum ordinal represented as Long. assertTag defaults to Asn1Element.Tag.ENUM, but can be overridden (for implicitly tagged enums, for example)
Exception-free version of decodeToEnumOrdinal
Exception-free version of decodeToEnum
Decode the Asn1Primitive as a Float. Beware of probable loss of precision!
Exception-free version of decodeToFloat. Beware of probable loss of precision!
decodes this Asn1Primitive's content into a Asn1String.General. assertTag defaults to Asn1Element.Tag.STRING_GENERAL, but can be overridden (for implicitly tagged strings, for example)
decodes this Asn1Primitive's content into a Asn1String.Graphic. assertTag defaults to Asn1Element.Tag.STRING_GRAPHIC, but can be overridden (for implicitly tagged strings, for example)
decodes this Asn1Primitive's content into a Asn1String.IA5. assertTag defaults to Asn1Element.Tag.STRING_IA5, but can be overridden (for implicitly tagged strings, for example)
decodes this Asn1Primitive's content into an Instant if it is encoded as UTC TIME or GENERALIZED TIME
Exception-free version of decodeToInstant
decodes this Asn1Primitive's content into an Int. assertTag defaults to Asn1Element.Tag.INT, but can be overridden (for implicitly tagged integers, for example)
Exception-free version of decodeToInt
decodes this Asn1Primitive's content into a Long. assertTag defaults to Asn1Element.Tag.INT, but can be overridden (for implicitly tagged longs, for example)
Exception-free version of decodeToLong
decodes this Asn1Primitive's content into a Asn1String.Numeric. assertTag defaults to Asn1Element.Tag.STRING_NUMERIC, but can be overridden (for implicitly tagged strings, for example)
decodes this Asn1Primitive's content into a Asn1String.Printable. assertTag defaults to Asn1Element.Tag.STRING_PRINTABLE, but can be overridden (for implicitly tagged strings, for example)
Decodes this Asn1Primitive's content into a String.
Exception-free version of decodeToString
decodes this Asn1Primitive's content into a Asn1String.Teletex. assertTag defaults to Asn1Element.Tag.STRING_T61, but can be overridden (for implicitly tagged strings, for example)
decodes this Asn1Primitive's content into an UInt√. assertTag defaults to Asn1Element.Tag.INT, but can be overridden (for implicitly tagged unsigned integers, for example)
Exception-free version of decodeToUInt
decodes this Asn1Primitive's content into an ULong. assertTag defaults to Asn1Element.Tag.INT, but can be overridden (for implicitly tagged unsigned longs, for example)
Exception-free version of decodeToULong
decodes this Asn1Primitive's content into a Asn1String.Universal. assertTag defaults to Asn1Element.Tag.STRING_UNIVERSAL, but can be overridden (for implicitly tagged strings, for example)
decodes this Asn1Primitive's content into a Asn1String.Unrestricted. assertTag defaults to Asn1Element.Tag.STRING_UNRESTRICTED, but can be overridden (for implicitly tagged strings, for example)
decodes this Asn1Primitive's content into a Asn1String.UTF8. assertTag defaults to Asn1Element.Tag.STRING_UTF8, but can be overridden (for implicitly tagged strings, for example)
decodes this Asn1Primitive's content into a Asn1String.Videotex. assertTag defaults to Asn1Element.Tag.STRING_VIDEOTEX, but can be overridden (for implicitly tagged strings, for example)
decodes this Asn1Primitive's content into a Asn1String.Visible. assertTag defaults to Asn1Element.Tag.STRING_VISIBLE, but can be overridden (for implicitly tagged strings, for example)
decodes this Asn1Primitive to null (i.e. verifies the tag to be BERTags.ASN1_NULL and the content to be empty
Name seems odd, but this is just an exception-free version of readNull
decodes this Asn1Primitive's content into an ObjectIdentifier
Stack-safe renderer that writes this element's compact (pretty = false) or indented (pretty = true) string form as UTF-8 into out, stopping after limit characters (appending a truncation marker). Expressed with DeepRecursiveFunction so deep nesting cannot overflow the call stack; reuses the per-node prettyPrintHeader/prettyPrintTrailer/contentToString so output is unchanged for ordinary elements.
Convenience method to directly produce an HEX string of this element's ASN.1 representation
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, use element withImplicitTag (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.
Creates a new implicitly tagged ASN.1 Element from this ASN.1 Element. Sets the class of the resulting structure to TagClass.CONTEXT_SPECIFIC