Asn1String
ASN.1 String class used as wrapper do discriminate between different ASN.1 string types By default, the string value is decoded using UTF-8. If a different charset or custom decoding is needed, the rawValue property can be used directly.
Under DER serialization with awesn1.kxs, generic Asn1String values are decoded by their universal ASN.1 string tag. This means generic Asn1String must not be used together with implicit tag overrides such as @Asn1Tag, because the concrete string subtype would no longer be recoverable from the wire representation. Use a concrete subtype like UTF8, IA5, Printable, Visible, or Numeric when implicit tagging is required.
String values are internally represented as raw ByteArray. Generic Asn1String decoding preserves even malformed string content and reports its status through isValid. Decoding to a concrete subtype is strict and throws when validation returns false; null means that no complete validator exists and is therefore accepted.
Inheritors
Types
BMP STRING, encoded as big-endian UCS-2 (surrogate code units are forbidden).
GENERAL STRING.
GRAPHIC STRING.
IA5 STRING.
NUMERIC STRING.
PRINTABLE STRING.
TELETEX (T61) STRING.
UNIVERSAL STRING, encoded as big-endian 32-bit Unicode scalar values.
CHARACTER/UNRESTRICTED STRING (no checks)
UTF8 STRING (ISO/IEC 10646, encoded as UTF-8 per RFC 3629).
VIDEOTEX STRING (no checks) Validation is not implemented. This type is no longer used in practice.
VISIBLE STRING (a.k.a. ISO646String).
Properties
The UTF-8 interpretation of rawValue by default; wide-character subtypes override this. The decoding is performed via String.decodeFromAsn1ContentBytes(rawValue), which internally uses the standard library's ByteArray.decodeToString.
Functions
Convenience function to directly get the DER-encoded representation of the implementing object
Exception-free version of encodeToDer
Encodes the implementing object into an A
Exception-free version of Asn1Encodable.encodeToTlv
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.
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
Creates a new implicitly tagged ASN.1 Element from this ASN.1 Element. Sets the class of the resulting structure to TagClass.CONTEXT_SPECIFIC