### Decoding ASN.1 Data Source: https://pub.dev/documentation/asn1lib/latest Shows how to parse BER-encoded bytes into ASN.1 objects. Includes an example of relaxed parsing for unsupported structures. ```dart import 'package:asn1lib/asn1lib.dart'; // e.g. bytes from the Encoding Example var p = ASN1Parser(bytes); var s2 = p.nextObject(); // s2 is a sequence... // relaxed parsing, returning a generic ASN1Object from (yet) unsupported structures, instead of throwing var p2 = ASN1Parser(bytes, relaxedParsing: true); var s3 = p2.nextObject(); // s3 is a sequence... ``` -------------------------------- ### ASN1Object.fromBytes Constructor Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Object/ASN1Object.fromBytes.html This snippet shows the implementation of the ASN1Object.fromBytes constructor. It parses the tag, calculates extended tags if present, decodes the length, and determines the starting position of the value within the provided bytes. ```dart ASN1Object.fromBytes(Uint8List bytes) : tag = bytes[0] { _encodedBytes = bytes; // _initFromBytes(); var offset = 1; // offset where the length bytes start // This is an extended tag if all the lower 5 bits are 1s if ((tag & 0x1f) == 0x1f) { var (tag, o) = _calculateExtendedTag(bytes); _extendedTag = tag; offset = o; } var (l, v) = ASN1Object.decodeLength(_encodedBytes!, offset: offset); _valueByteLength = l; _valueStartPosition = v; } ``` -------------------------------- ### Get UTF-8 String Value Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1OctetString/utf8StringValue.html Retrieves the string value from the octet bytes by decoding them as UTF-8. This is the standard way to get a human-readable string from an OctetString when UTF-8 encoding is expected. ```dart String get utf8StringValue => utf8.decode(octets); ``` -------------------------------- ### ASN1UTF8String Constructors Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1UTF8String-class.html Provides information on how to create instances of the ASN1UTF8String class. ```APIDOC ## Constructors ### ASN1UTF8String(String utf8StringValue, {int tag = UTF8_STRING_TYPE}) * **Description**: Create an ASN1UTF8String initialized with String value. * **Parameters**: * `utf8StringValue` (String) - The string value for the UTF8 string. * `tag` (int, optional) - The ASN.1 tag for the UTF8 string. Defaults to `UTF8_STRING_TYPE`. ### ASN1UTF8String.fromBytes(Uint8List bytes) * **Description**: Create an ASN1UTF8String from an encoded list of bytes. * **Parameters**: * `bytes` (Uint8List) - The list of bytes representing the encoded UTF8 string. ``` -------------------------------- ### ASN1IA5String Constructors Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1IA5String-class.html Provides information on how to create instances of the ASN1IA5String class. ```APIDOC ## ASN1IA5String Constructors ### ASN1IA5String(String stringValue, {int tag = IA5_STRING_TYPE}) * **Description**: Create an ASN1IA5String initialized with String value. Optionally override the tag. * **Parameters**: * `stringValue` (String) - The string value for the IA5 String. * `tag` (int, optional) - The ASN.1 tag for the IA5 String. Defaults to `IA5_STRING_TYPE`. ### ASN1IA5String.fromBytes(Uint8List bytes) * **Description**: Create an ASN1IA5String from an encoded list of bytes. * **Parameters**: * `bytes` (Uint8List) - The encoded byte list representing the IA5 String. ``` -------------------------------- ### Get ASN1Object Extended Tag Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Object/extendedTag.html Retrieves the extended tag value from an ASN.1 object. This getter is part of the ASN1Object implementation. ```dart int? get extendedTag => _extendedTag; ``` -------------------------------- ### ASN1Application Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Application/ASN1Application.html Initializes a new instance of the ASN1Application class. The constructor accepts an optional integer tag, which defaults to APPLICATION_CLASS. ```APIDOC ## ASN1Application Constructor ### Description Initializes a new instance of the ASN1Application class. The constructor accepts an optional integer tag, which defaults to APPLICATION_CLASS. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method Signature ASN1Application({int tag = APPLICATION_CLASS}) ### Implementation ```dart ASN1Application({super.tag = APPLICATION_CLASS}); ``` ``` -------------------------------- ### ASN1Application.fromBytes Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Application/ASN1Application.fromBytes.html Initializes an ASN1Application object from a Uint8List. It validates that the provided tag corresponds to an ASN.1 Application class. ```APIDOC ## ASN1Application.fromBytes constructor ### Description Constructs an ASN1Application object from a Uint8List. It validates that the provided tag corresponds to an ASN.1 Application class. ### Parameters #### Path Parameters - **bytes** (Uint8List) - Required - The byte data representing the ASN.1 Application. ### Implementation Notes The constructor checks if the tag is an ASN.1 Application type. If not, it throws an ASN1Exception. ``` -------------------------------- ### Get Integer Value of ASN1Integer Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Integer/intValue.html Access the intValue property to retrieve the integer representation of an ASN.1 Integer. This requires the value to be representable as a standard Dart int. ```dart int get intValue => valueAsBigInteger.toInt(); ``` -------------------------------- ### ASN1IA5String.new constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1IA5String/ASN1IA5String.html Creates an ASN1IA5String initialized with a String value. The tag can be optionally overridden. ```APIDOC ## ASN1IA5String(String stringValue, {int tag = IA5_STRING_TYPE}) ### Description Creates an ASN1IA5String initialized with a String value. Optionally override the tag. ### Parameters #### Path Parameters - **stringValue** (String) - Required - The string value to initialize the ASN1IA5String with. - **tag** (int) - Optional - The tag to assign to the ASN1IA5String. Defaults to IA5_STRING_TYPE. ### Implementation ```dart ASN1IA5String(this.stringValue, {super.tag = IA5_STRING_TYPE}); ``` ``` -------------------------------- ### Get ASN.1 Object Value Bytes Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Object/valueBytes.html Returns a view into the encoded byte buffer representing the value of the ASN.1 object. This is an efficient way to access the raw bytes. ```dart Uint8List valueBytes() { return Uint8List.view(encodedBytes.buffer, _valueStartPosition + encodedBytes.offsetInBytes, _valueByteLength); } ``` -------------------------------- ### ASN1BMPString Constructors Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1BMPString-class.html Provides documentation for the two constructors available for the ASN1BMPString class: one for initializing with a string value and another for creating from encoded bytes. ```APIDOC ## ASN1BMPString Constructors ### ASN1BMPString(String stringValue, {int tag = BMP_STRING_TYPE}) * **Description**: Creates an ASN1BMPString initialized with a String value. Optionally override the tag. * **Parameters**: * `stringValue` (String) - Required - The string value to initialize the BMPString with. * `tag` (int) - Optional - The ASN.1 tag type, defaults to `BMP_STRING_TYPE`. ### ASN1BMPString.fromBytes(Uint8List bytes) * **Description**: Creates an ASN1BMPString from an encoded list of bytes. * **Parameters**: * `bytes` (Uint8List) - Required - The encoded byte list to decode into an ASN1BMPString. ``` -------------------------------- ### Get ASN1OctetString as String Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1OctetString/stringValue.html Retrieves the string value of an ASN.1 Octet String using Dart's default UTF-16 decoding. Use utf8StringValue or utf16StringValue for explicit encoding. ```dart String get stringValue => String.fromCharCodes(octets); ``` -------------------------------- ### ASN1Sequence.new constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Sequence/ASN1Sequence.html Creates a new empty ASN1 Sequence. You can optionally override the default tag. ```APIDOC ## ASN1Sequence.new constructor ### Description Creates a new empty ASN1 Sequence. Optionally override the default tag. ### Method Constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **tag** (int) - Optional - The tag for the sequence. Defaults to `CONSTRUCTED_SEQUENCE_TYPE`. ### Request Example ```dart ASN1Sequence({ int tag = CONSTRUCTED_SEQUENCE_TYPE, }) ``` ### Response #### Success Response (200) - **ASN1Sequence** - A new instance of ASN1Sequence. #### Response Example ```dart ASN1Sequence mySequence = ASN1Sequence(); // Uses default tag ASN1Sequence taggedSequence = ASN1Sequence(tag: 10); // Uses custom tag ``` ``` -------------------------------- ### encodedBytes Property Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Object/encodedBytes.html Gets the encoded byte representation for this ASN.1 object. It triggers the subclass's `_encode` method if the object has not yet been encoded. An ASN1Exception is thrown if encoding fails. ```APIDOC ## encodedBytes Property ### Description Gets the encoded byte representation for this ASN.1 object. This can trigger calling the subclass's `_encode` method if the object has not yet been encoded. ### Type `Uint8List` ### Usage ```dart ASN1Object obj = ...; Uint8List encoded = obj.encodedBytes; ``` ### Implementation Details If the `_encodedBytes` is null, the `_encode()` method is called. If `_encodedBytes` remains null after encoding, an `ASN1Exception` is thrown, indicating an encoding failure. ``` -------------------------------- ### Get UTF-16 String Value from Octets Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1OctetString/utf16StringValue.html This snippet shows how to retrieve the UTF-16 string representation from the octet data of an ASN.1 OctetString. It uses Dart's String.fromCharCodes to perform the conversion. ```dart String get utf16StringValue => String.fromCharCodes(octets); ``` -------------------------------- ### ASN1BitString Constructors Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1BitString-class.html Provides constructors for creating ASN1BitString objects. ```APIDOC ## ASN1BitString(List stringValue, {int unusedbits = 0, int tag = BIT_STRING_TYPE}) ### Description Create an ASN1BitString initialized with String value. Optionally override the tag. ### Parameters #### Path Parameters - **stringValue** (List) - Required - The list of integer character codes representing the string value. - **unusedbits** (int) - Optional - The number of unused bits in the last byte. Defaults to 0. - **tag** (int) - Optional - The ASN.1 tag for the bit string. Defaults to BIT_STRING_TYPE. ``` ```APIDOC ## ASN1BitString.fromBytes(Uint8List bytes) ### Description Create an ASN1OctetString from an encoded list of bytes. ### Parameters #### Path Parameters - **bytes** (Uint8List) - Required - The encoded byte list. ``` -------------------------------- ### Initialize ASN1Set Elements Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Set/elements.html Demonstrates how to initialize an empty set for ASN1Object elements within an ASN1Set. ```javascript Set elements = {}; ``` -------------------------------- ### Get ASN.1 Object Encoded Bytes Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Object/encodedBytes.html Retrieves the encoded byte representation of an ASN.1 object. It calls the internal `_encode` method if the bytes are not yet computed. Throws an ASN1Exception if encoding fails. ```dart Uint8List get encodedBytes { if (_encodedBytes == null) { _encode(); } if (_encodedBytes == null) { throw ASN1Exception('ASN1 Encoding failed. This should never happen'); } return _encodedBytes!; } ``` -------------------------------- ### ASN1Application Constructors Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Application-class.html Constructors for creating ASN1Application objects. ```APIDOC ## Constructors ### ASN1Application() Creates a new ASN1Application object with a default application class tag. ### ASN1Application.fromBytes(Uint8List bytes) Creates a new ASN1Application object from a list of bytes. Note: The tag needs to be overridden after creation. ``` -------------------------------- ### Get Total Encoded Byte Length Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Object/totalEncodedByteLength.html This property calculates the total byte length of the ASN.1 object, encompassing the tag, length, and value bytes. It is useful for stream parsing to identify the end of an object. ```dart int get totalEncodedByteLength => _valueStartPosition + _valueByteLength; ``` -------------------------------- ### ASN1Object.new constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Object/ASN1Object.html Creates a new ASN1Object. The tag can be optionally set during initialization. ```APIDOC ## ASN1Object.new constructor ### Description Creates a new ASN1Object. Optionally set the tag. ### Method Constructor ### Parameters #### Path Parameters - **tag** (int) - Optional - The tag for the ASN1Object. Defaults to 0. ### Request Example ```dart ASN1Object({ int tag = 0, }) ``` ### Response #### Success Response (200) - **ASN1Object** - An instance of ASN1Object. #### Response Example ```dart ASN1Object(tag: 10) ``` ``` -------------------------------- ### Get String Value of Octet String Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1IpAddress/stringValue.html Retrieves the string representation of the octet string using Dart's default UTF-16 decoding. This method is deprecated; use utf8StringValue or utf16StringValue for explicit encoding. ```dart @override String get stringValue => octets.join('.'); ``` -------------------------------- ### Initialize ASN.1 Sequence Elements Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Sequence/elements.html Demonstrates how to initialize an empty list for the elements property of an ASN.1 Sequence. ```dart List elements = []; ``` -------------------------------- ### ASN1Object toString Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Object/toString.html This snippet shows the implementation of the toString method for ASN1Object. It formats the output to include the tag in hexadecimal, the length of the value in bytes, the starting position of the value, and the hexadecimal representation of the bytes. ```dart @override String toString() => 'ASN1Object(tag=${tag.toRadixString(16)} valueByteLength=$_valueByteLength) startpos=$_valueStartPosition bytes=${toHexString()}'; ``` -------------------------------- ### ASN1IpAddress.fromBytes Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1IpAddress/ASN1IpAddress.fromBytes.html Constructs an ASN1IpAddress from a Uint8List of bytes. It asserts the validity of the byte length upon creation. ```APIDOC ## ASN1IpAddress.fromBytes constructor ### Description Creates an ASN1IpAddress from an encoded list of bytes. ### Parameters #### Path Parameters - **bytes** (Uint8List) - Required - The list of bytes representing the IP address. ``` -------------------------------- ### ASN1Sequence Constructors Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Sequence-class.html Provides documentation for the constructors of the ASN1Sequence class, used for creating new sequence objects. ```APIDOC ## Constructors ### ASN1Sequence() Create a new empty ASN1 Sequence. Optionally override the default tag. ### ASN1Sequence.fromBytes(Uint8List bytes) Create a sequence from the byte array `super.bytes`. ``` -------------------------------- ### Decode ASN.1 Length Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Object/decodeLength.html Decodes the ASN.1 length field from a Uint8List. It returns a record containing the decoded length and the starting position of the value within the byte array. The offset parameter indicates where the length bytes begin. ```Dart static (int length, int valueStart) decodeLength(Uint8List encodedBytes, {int offset = 1}) { var valueStartPosition = offset + 1; //default var length = encodedBytes[offset] & 0x7F; if (length != encodedBytes[offset]) { var numLengthBytes = length; length = 0; for (var i = 0; i < numLengthBytes; i++) { length <<= 8; length |= encodedBytes[valueStartPosition++] & 0xFF; } } return (length, valueStartPosition); } ``` -------------------------------- ### decodeLength static method Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Object/decodeLength.html Decodes the ASN.1 length field from the provided encoded bytes. It returns a record containing the decoded length and the starting position of the value within the byte array. The `offset` parameter specifies where the length encoding begins. ```APIDOC ## decodeLength(Uint8List encodedBytes, {int offset = 1}) ### Description Decodes the ASN.1 length field from the encoded bytes. This method has no side effects on an object. It returns a record with (length, valueStartPosition), where `length` is the length in bytes of the object, and `valueStartPosition` is the offset where the values start within the byte array (after the tag and the length bytes). Usually, the first byte is the tag followed by the length encoding. `offset` is where the length bytes start in the byte array. For most objects, this will be right after the tag at position 1. ### Parameters #### Path Parameters - **encodedBytes** (Uint8List) - Required - The byte array containing the ASN.1 encoded data. - **offset** (int) - Optional - The starting offset within `encodedBytes` where the length field begins. Defaults to 1. ### Returns - **(int length, int valueStart)** - A record where `length` is the decoded length and `valueStart` is the offset to the start of the value data. ``` -------------------------------- ### ASN1BitString Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1BitString/ASN1BitString.html Creates an ASN1BitString initialized with a list of integers representing the string value. It also allows for optional specification of unused bits and the ASN.1 tag. ```APIDOC ## ASN1BitString(List stringValue, {int unusedbits = 0, int tag = BIT_STRING_TYPE}) ### Description Creates an ASN1BitString initialized with a list of integers representing the string value. Optionally override the tag. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method Signature ```dart ASN1BitString(List stringValue, {int unusedbits = 0, int tag = BIT_STRING_TYPE}) ``` ### Implementation ```dart ASN1BitString(this.stringValue, {this.unusedbits = 0, super.tag = BIT_STRING_TYPE}); ``` ### Parameters - **stringValue** (List) - Required - The list of integers representing the bit string value. - **unusedbits** (int) - Optional - The number of unused bits in the last byte. Defaults to 0. - **tag** (int) - Optional - The ASN.1 tag for the bit string. Defaults to BIT_STRING_TYPE. ``` -------------------------------- ### ASN1Application Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Application/ASN1Application.html Initializes an ASN1Application object with the default tag for the application class. ```dart ASN1Application({super.tag = APPLICATION_CLASS}); ``` -------------------------------- ### ASN1IpAddress fromComponents Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1IpAddress/fromComponents.html This is the static method implementation for creating an ASN1IpAddress from a list of integer components. ```dart static ASN1IpAddress fromComponents(List components, {int tag = IP_ADDRESS}) => ASN1IpAddress(components, tag: tag); ``` -------------------------------- ### ASN1UTF8String Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1UTF8String/ASN1UTF8String.html Creates an ASN1UTF8String initialized with a String value. The tag can optionally be overridden. ```APIDOC ## ASN1UTF8String.new constructor ### Description Creates an ASN1UTF8String initialized with a String value. Optionally override the tag. ### Method ```dart ASN1UTF8String(String utf8StringValue, {int tag = UTF8_STRING_TYPE}) ``` ### Parameters #### Path Parameters - **utf8StringValue** (String) - Required - The string value for the UTF8 string. - **tag** (int) - Optional - The ASN.1 tag for the string. Defaults to `UTF8_STRING_TYPE`. ``` -------------------------------- ### Static Methods Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1ObjectIdentifier-class.html Provides static methods for creating ASN1ObjectIdentifier instances from various formats. ```APIDOC ## Static Methods - **fromComponents(List components, {int tag = OBJECT_IDENTIFIER}) → ASN1ObjectIdentifier** - **fromComponentString(String path, {int tag = OBJECT_IDENTIFIER}) → ASN1ObjectIdentifier** - **fromName(String name, {int tag = OBJECT_IDENTIFIER}) → ASN1ObjectIdentifier** - **registerFrequentNames() → void** - **registerManyNames(Map pairs) → void** - **registerObjectIdentiferName(String name, ASN1ObjectIdentifier oid) → void** ``` -------------------------------- ### ASN1UTF8String.fromBytes Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1UTF8String/ASN1UTF8String.fromBytes.html Creates an ASN1UTF8String from a Uint8List. The constructor decodes the provided bytes into a UTF-8 string. ```APIDOC ## ASN1UTF8String.fromBytes constructor ### Description Creates an ASN1UTF8String from a Uint8List. The constructor decodes the provided bytes into a UTF-8 string. ### Method Signature ASN1UTF8String.fromBytes(Uint8List bytes) ### Parameters #### Path Parameters - **bytes** (Uint8List) - Required - The list of bytes to decode into a UTF-8 string. ``` -------------------------------- ### ASN1IpAddress Static Methods Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1IpAddress-class.html Static methods for creating ASN1IpAddress objects from different formats. ```APIDOC ## Static Methods ### fromComponents(List components, {int tag = IP_ADDRESS}) * **Description**: Create an ASN1IpAddress from a list of int IP Address octets (e.g., `192, 168, 1, 1`). * **Parameters**: * `components` (List) - A list of integers representing the IP address octets. * `tag` (int, optional) - The ASN.1 tag for the IP address. Defaults to `IP_ADDRESS`. ### fromComponentString(String path, {int tag = IP_ADDRESS}) * **Description**: Create an ASN1IpAddress from an IP Address String (such as '192.168.1.1'). * **Parameters**: * `path` (String) - The IP address string. * `tag` (int, optional) - The ASN.1 tag for the IP address. Defaults to `IP_ADDRESS`. ``` -------------------------------- ### Encoding ASN.1 Objects to BER Source: https://pub.dev/packages/asn1lib Demonstrates how to create and encode ASN.1 objects like sequences, integers, octet strings, and booleans into BER byte format. ```dart import 'package:asn1lib/asn1lib.dart'; var s = ASN1Sequence(); s.add(ASN1Integer(23)); s.add(ASN1OctetString('This is a test')); s.add(ASN1Boolean(true)); // GET the BER Stream var bytes = s . encodedBytes; ``` -------------------------------- ### ASN1ContextSpecific.fromBytes Constructor Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1ContextSpecific/ASN1ContextSpecific.fromBytes.html This snippet shows the implementation of the ASN1ContextSpecific.fromBytes constructor. It initializes the object with bytes and validates that the tag is indeed context-specific. ```dart ASN1ContextSpecific.fromBytes(super.bytes) : super.fromBytes() { // check that this really is an Private type if (!isContextSpecific(tag)) { throw ASN1Exception('tag $tag is not an ASN1 Context specific class'); } } ``` -------------------------------- ### ASN1BMPString Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1BMPString/ASN1BMPString.html Creates an ASN1BMPString initialized with a String value. The tag can optionally be overridden. ```APIDOC ## ASN1BMPString Constructor ### Description Initializes a new instance of the ASN1BMPString class with a given string value. An optional tag can be provided to override the default BMP_STRING_TYPE. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **stringValue** (String) - Required - The string value to initialize the ASN1BMPString with. - **tag** (int) - Optional - The tag for the ASN1BMPString. Defaults to BMP_STRING_TYPE. ### Request Example ```dart ASN1BMPString("Hello World", tag: 123) ``` ### Response #### Success Response (200) An ASN1BMPString object is created. #### Response Example ```dart ASN1BMPString("Hello World") ``` ## Implementation ```dart ASN1BMPString(this.stringValue, {super.tag = BMP_STRING_TYPE}); ``` ``` -------------------------------- ### ASN1Application.fromBytes Constructor Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Application/ASN1Application.fromBytes.html This snippet shows the implementation of the ASN1Application.fromBytes constructor. It initializes the superclass with the provided bytes and then checks if the tag is of the ASN1 Application class. An ASN1Exception is thrown if the tag is invalid. ```dart ASN1Application.fromBytes(super.bytes) : super.fromBytes() { // check that this really is an application type if (!isApplication(tag)) { throw ASN1Exception('tag $tag is not an ASN1 Application class'); } } ``` -------------------------------- ### ASN1BitString Methods Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1BitString-class.html Provides methods for interacting with ASN1BitString objects. ```APIDOC ## contentBytes() → Uint8List ### Description Returns the real content of a tag. This might be equal to valueBytes for some tags. ### Returns Uint8List - The content bytes. ``` ```APIDOC ## noSuchMethod(Invocation invocation) → dynamic ### Description Invoked when a nonexistent method or property is accessed. ### Parameters #### Path Parameters - **invocation** (Invocation) - Required - The invocation details. ### Returns dynamic ``` ```APIDOC ## toHexString() → String ### Description Converts the bit string to its hexadecimal representation. ### Returns String - The hexadecimal string. ``` ```APIDOC ## toString() → String ### Description A string representation of this object. ### Returns String - The string representation. ``` ```APIDOC ## valueBytes() → Uint8List ### Description Return just the value bytes. ### Returns Uint8List - The value bytes. ``` -------------------------------- ### ASN1Object Constructors Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Object-class.html Provides different ways to create an ASN1Object instance. ```APIDOC ## ASN1Object Constructors ### ASN1Object({int tag = 0}) * Description: Create an ASN1Object. Optionally set the tag. ### ASN1Object.fromBytes(Uint8List bytes) * Description: Create an ASN1Object from the given `bytes`. ### ASN1Object.preEncoded(int tag, Uint8List valBytes) * Description: Create an object that encapsulates a set of value bytes that are already encoded. ``` -------------------------------- ### ASN1IpAddress Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1IpAddress/ASN1IpAddress.html Creates an ASN1IpAddress object initialized with a list of octets. An optional tag can be provided to override the default IP_ADDRESS tag. The octets must be valid integers between 0 and 255. ```APIDOC ## ASN1IpAddress(List octets, {int tag = IP_ADDRESS}) ### Description Creates an ASN1IpAddress object initialized with a list of octets. An optional tag can be provided to override the default IP_ADDRESS tag. The octets must be valid integers between 0 and 255. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method Constructor ### Endpoint None ### Request Example ```dart // Example of creating an ASN1IpAddress var ipAddress = ASN1IpAddress([192, 168, 1, 1]); ``` ### Response #### Success Response An ASN1IpAddress object. #### Response Example ```dart // Example of a successful response (object creation) ASN1IpAddress ipAddress = ASN1IpAddress([192, 168, 1, 1]); ``` ### Implementation Details ```dart ASN1IpAddress(List octets, {int tag = IP_ADDRESS}) : super(octets, tag: tag) { _assertValidLength(this.octets); for (var o in octets) { if (0 > o || o > 255) { throw ArgumentError('Octet out of range!.'); } } } ``` ``` -------------------------------- ### ASN1IA5String.fromBytes Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1IA5String/ASN1IA5String.fromBytes.html Creates an ASN1IA5String from an encoded list of bytes. The constructor decodes the byte list into an ASCII string. ```APIDOC ## ASN1IA5String.fromBytes constructor ### Description Creates an ASN1IA5String from an encoded list of bytes. The constructor decodes the byte list into an ASCII string. ### Parameters #### Path Parameters - **bytes** (Uint8List) - Required - The encoded list of bytes to create the ASN1IA5String from. ### Implementation ```dart ASN1IA5String.fromBytes(super.bytes) : super.fromBytes() { var octets = valueBytes(); stringValue = ascii.decode(octets); } ``` ``` -------------------------------- ### Methods Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1ObjectIdentifier-class.html Provides methods for encoding, converting to string, and retrieving content bytes. ```APIDOC ## Methods - **contentBytes() → Uint8List**: Returns the real content of a tag. This might be equal to valueBytes for some tags. - **noSuchMethod(Invocation invocation) → dynamic**: Invoked when a nonexistent method or property is accessed. - **toHexString() → String**: No description available. - **toString() → String**: A string representation of this object. - **valueBytes() → Uint8List**: Return just the value bytes. ``` -------------------------------- ### ASN1IpAddress Constructors Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1IpAddress-class.html Constructors for creating ASN1IpAddress objects. You can initialize with a list of octets or from a byte array. ```APIDOC ## Constructors ### ASN1IpAddress(List octets, {int tag = IP_ADDRESS}) * **Description**: Create an ASN1IpAddress initialized with a String or a List. Optionally override the tag. * **Parameters**: * `octets` (List) - The list of integer octets representing the IP address. * `tag` (int, optional) - The ASN.1 tag for the IP address. Defaults to `IP_ADDRESS`. ### ASN1IpAddress.fromBytes(Uint8List bytes) * **Description**: Create an ASN1IpAddress from an encoded list of bytes. * **Parameters**: * `bytes` (Uint8List) - The byte array containing the encoded IP address. ``` -------------------------------- ### ASN1ContextSpecific.fromBytes Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1ContextSpecific/ASN1ContextSpecific.fromBytes.html The ASN1ContextSpecific.fromBytes constructor takes a Uint8List as input and initializes the object. It includes a check to ensure the tag is indeed a Context Specific type, throwing an ASN1Exception if it is not. ```APIDOC ## ASN1ContextSpecific.fromBytes constructor ### Description Constructs an ASN1ContextSpecific object from a list of bytes. ### Parameters #### Path Parameters - **bytes** (Uint8List) - Required - The list of bytes representing the ASN.1 data. ### Implementation Notes The constructor verifies that the tag of the provided bytes corresponds to a Context Specific type. If the tag is not a Context Specific type, an ASN1Exception is thrown. ```dart ASN1ContextSpecific.fromBytes(Uint8List bytes) : super(bytes) { // check that this really is an Private type if (!isContextSpecific(tag)) { throw ASN1Exception('tag $tag is not an ASN1 Context specific class'); } } ``` ``` -------------------------------- ### ASN1IpAddress fromComponentString Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1IpAddress/fromComponentString.html This static method creates an ASN1IpAddress from a dot-separated IP address string. It splits the string by '.', parses each part as an integer, and then uses the fromComponents method to construct the ASN1IpAddress. The tag parameter can be optionally specified. ```dart static ASN1IpAddress fromComponentString(String path, {int tag = IP_ADDRESS}) => fromComponents(path.split('.').map(int.parse).toList(), tag: tag); ``` -------------------------------- ### ASN1IpAddress.fromBytes Constructor Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1IpAddress/ASN1IpAddress.fromBytes.html This snippet shows the implementation of the ASN1IpAddress.fromBytes constructor. It calls the superclass constructor and then asserts the validity of the octet length. ```dart ASN1IpAddress.fromBytes(super.bytes) : super.fromBytes() { _assertValidLength(octets); } ``` -------------------------------- ### ASN1ObjectIdentifier.fromComponentString Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1ObjectIdentifier/fromComponentString.html This snippet shows the implementation of the `fromComponentString` static method. It takes a string path, splits it by dots, parses each component into an integer, and then uses these components to create an `ASN1ObjectIdentifier` via the `fromComponents` method. An optional tag can be provided. ```dart static ASN1ObjectIdentifier fromComponentString(String path, {int tag = OBJECT_IDENTIFIER}) => fromComponents(path.split('.').map(int.parse).toList(), tag: tag); ``` -------------------------------- ### Encoding ASN.1 Data Source: https://pub.dev/documentation/asn1lib/latest Demonstrates how to create and encode an ASN.1 sequence with integer, octet string, and boolean values. ```dart import 'package:asn1lib/asn1lib.dart'; var s = ASN1Sequence(); s.add(ASN1Integer(23)); s.add(ASN1OctetString('This is a test')); s.add(ASN1Boolean(true)); // GET the BER Stream var bytes = s . encodedBytes; ``` -------------------------------- ### ASN1IA5String.fromBytes Constructor Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1IA5String/ASN1IA5String.fromBytes.html This snippet shows the implementation of the ASN1IA5String.fromBytes constructor. It takes a list of bytes, decodes them using ASCII, and assigns the result to stringValue. ```dart ASN1IA5String.fromBytes(super.bytes) : super.fromBytes() { var octets = valueBytes(); stringValue = ascii.decode(octets); } ``` -------------------------------- ### ASN1NumericString Constructors Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1NumericString-class.html Provides documentation for the constructors of the ASN1NumericString class, used for creating instances from string values or encoded bytes. ```APIDOC ## ASN1NumericString Constructors ### ASN1NumericString(String stringValue, {int tag = NUMERIC_STRING_TYPE}) **Description**: Creates an ASN1NumericString initialized with a String value. ### ASN1NumericString.fromBytes(Uint8List bytes) **Description**: Creates an ASN1NumericString from an encoded list of bytes. ``` -------------------------------- ### ASN1OctetString.fromBytes Constructor Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1OctetString/ASN1OctetString.fromBytes.html This is the implementation of the ASN1OctetString.fromBytes constructor. It initializes the octets property with the value bytes. ```dart ASN1OctetString.fromBytes(super.bytes) : super.fromBytes() { octets = valueBytes(); } ``` -------------------------------- ### ASN1Application Methods Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Application-class.html Methods available for ASN1Application objects. ```APIDOC ## Methods - **contentBytes()**: `Uint8List` - Returns the real content of a tag. - **noSuchMethod(Invocation invocation)**: `dynamic` - Invoked when a nonexistent method or property is accessed. - **toHexString()**: `String` - Converts the object to a hexadecimal string representation. - **toString()**: `String` - A string representation of this object. - **valueBytes()**: `Uint8List` - Return just the value bytes. ``` -------------------------------- ### ASN1BitString Static Methods Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1BitString-class.html Provides static methods for decoding ASN.1 data. ```APIDOC ## decodeOctetString(Uint8List bytes) → String ### Description Decodes an ASN.1 Octet String from a byte list. ### Parameters #### Path Parameters - **bytes** (Uint8List) - Required - The encoded byte list. ### Returns String - The decoded string. ``` -------------------------------- ### ASN1BMPString.fromBytes Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1BMPString/ASN1BMPString.fromBytes.html Constructs an ASN1BMPString by decoding a Uint8List. The bytes are treated as a sequence of 16-bit unsigned integers (big-endian) which are then decoded into a string. ```APIDOC ## ASN1BMPString.fromBytes constructor ### Description Creates an ASN1BMPString from an encoded list of bytes. The constructor takes a `Uint8List` as input, interprets each pair of bytes as a 16-bit unsigned integer (big-endian), and then decodes these integers into a UTF-8 string. ### Method Signature ```dart ASN1BMPString.fromBytes(Uint8List bytes) ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **bytes** (Uint8List) - Required - The encoded list of bytes representing the BMPString. ``` -------------------------------- ### ASN1OctetString.fromBytes Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1OctetString/ASN1OctetString.fromBytes.html Creates an ASN1OctetString from an encoded list of bytes. ```APIDOC ## ASN1OctetString.fromBytes constructor ### Description Creates an ASN1OctetString from an encoded list of bytes. ### Parameters #### Path Parameters - **bytes** (Uint8List) - Required - The encoded list of bytes. ### Implementation ```dart ASN1OctetString.fromBytes(super.bytes) : super.fromBytes() { octets = valueBytes(); } ``` ``` -------------------------------- ### ASN1IpAddress Constructor Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1IpAddress/ASN1IpAddress.html Initializes an ASN1IpAddress with a list of octets and an optional tag. Validates octet values to be between 0 and 255 and checks for valid length. ```dart ASN1IpAddress(List octets, {int tag = IP_ADDRESS}) : super(octets, tag: tag) { _assertValidLength(this.octets); for (var o in octets) { if (0 > o || o > 255) { throw ArgumentError('Octet out of range!.'); } } } ``` -------------------------------- ### ASN1Integer.fromBytes Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Integer/ASN1Integer.fromBytes.html Creates an ASN1Integer instance by decoding a Uint8List. The constructor takes a byte list representing the ASN.1 encoded integer and initializes the object, decoding the value into a BigInteger. ```APIDOC ## ASN1Integer.fromBytes constructor ### Description Constructs an ASN1Integer object from a Uint8List of bytes. This method decodes the provided byte array, which is expected to be in ASN.1 integer format, into a BigInteger value. ### Parameters #### Path Parameters - **bytes** (Uint8List) - Required - The byte list containing the ASN.1 encoded integer value. ### Implementation Details The constructor initializes the superclass with the provided bytes and then proceeds to decode the `valueBytes` into a `BigInteger` using the `decodeBigInt` method. ``` -------------------------------- ### Constructors Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1ObjectIdentifier-class.html Provides constructors for creating ASN1ObjectIdentifier instances. ```APIDOC ## Constructors ### ASN1ObjectIdentifier ```dart ASN1ObjectIdentifier(List oi, {String? identifier, int tag = OBJECT_IDENTIFIER}) ``` ### ASN1ObjectIdentifier.fromBytes ```dart ASN1ObjectIdentifier.fromBytes(Uint8List bytes) ``` Instantiate a ASN1ObjectIdentifier from the given `bytes`. ``` -------------------------------- ### ASN1Set Methods Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Set-class.html Includes methods for adding elements to the set, retrieving content and value bytes, and converting the object to a string or hex string. ```APIDOC ## Methods ### add(ASN1Object o) → void Adds the given ASN1Object `o` to the set. ### contentBytes() → Uint8List Returns the actual content bytes of the ASN.1 tag. For some tags, this may be the same as `valueBytes()`. ### noSuchMethod(Invocation invocation) → dynamic Invoked when a nonexistent method or property is accessed. Inherited from Object. ### toHexString() → String Converts the ASN.1 object to its hexadecimal string representation. Inherited from ASN1Object. ### toString() → String Returns a string representation of this ASN1Set object. Overrides the default toString method. ``` -------------------------------- ### ASN1OctetString Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1OctetString/ASN1OctetString.html Creates an ASN1OctetString initialized with a String or a List. Optionally overrides the default ASN1 tag. The String is encoded as UTF-8 octets. ```APIDOC ## ASN1OctetString Constructor ### Description Initializes an ASN1OctetString with provided octets, which can be a String or a List. Allows for an optional custom tag, defaulting to OCTET_STRING_TYPE. ### Parameters * `octets` (dynamic) - Required - The data to be encoded as octets. Accepts String (encoded as UTF-8) or List. * `tag` (int) - Optional - The ASN.1 tag for the octet string. Defaults to `OCTET_STRING_TYPE`. ### Implementation Notes The constructor handles String input by encoding it to UTF-8. It also accepts Uint8List or List. An ArgumentError is thrown if the input type is not supported. ``` -------------------------------- ### ASN1Enumerated Methods Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Enumerated-class.html Includes methods for retrieving the content bytes, handling non-existent method calls, converting to a hexadecimal string, and providing a string representation of the object. ```APIDOC ## Methods * **contentBytes() → Uint8List** Returns the real content of a tag. This might be equal to valueBytes for some tags. * **noSuchMethod(Invocation invocation) → dynamic** Invoked when a nonexistent method or property is accessed. * **toHexString() → String** * **toString() → String** A string representation of this object. * **valueBytes() → Uint8List** Return just the value bytes. ``` -------------------------------- ### ASN1Integer.fromBytes Constructor Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Integer/ASN1Integer.fromBytes.html This snippet shows the implementation of the ASN1Integer.fromBytes constructor. It initializes the superclass with the provided bytes and then decodes the value bytes into a BigInteger. ```dart ASN1Integer.fromBytes(super.bytes) : super.fromBytes() { valueAsBigInteger = decodeBigInt(valueBytes()); } ``` -------------------------------- ### ASN1IA5String Methods Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1IA5String-class.html Lists the methods available for ASN1IA5String objects. ```APIDOC ## ASN1IA5String Methods ### contentBytes() → Uint8List * Description: Returns the real content of a tag. This might be equal to valueBytes for some tags. * Inherited: Yes ### noSuchMethod(Invocation invocation) → dynamic * Description: Invoked when a nonexistent method or property is accessed. * Inherited: Yes ### toHexString() → String * Inherited: Yes ### toString() → String * Description: A string representation of this object. * Override: Yes ### valueBytes() → Uint8List * Description: Return just the value bytes. * Inherited: Yes ``` -------------------------------- ### ASN1BitString.fromBytes Constructor Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1BitString/ASN1BitString.fromBytes.html Initializes an ASN1BitString with unused bits and the string value derived from the provided bytes. The first byte of the input bytes represents the unused bits, and the subsequent bytes form the string value. ```dart ASN1BitString.fromBytes(super.bytes) : super.fromBytes() { unusedbits = valueBytes()[0]; stringValue = valueBytes().sublist(1); } ``` -------------------------------- ### ASN1BMPString.fromBytes Constructor Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1BMPString/ASN1BMPString.fromBytes.html This snippet shows the implementation of the ASN1BMPString.fromBytes constructor. It takes a Uint8List of bytes, decodes them by merging high and low octets, and then converts the resulting integer list into a string using utf8.decode. ```Dart ASN1BMPString.fromBytes(super.bytes) : super.fromBytes() { var octets = valueBytes(); var mergedOctets = []; for (var i = 0; i < octets.length;) { var hi = octets[i++]; var lo = octets[i++]; mergedOctets.add((hi << 8) | lo); } stringValue = utf8.decode(mergedOctets); } ``` -------------------------------- ### ASN1BitString.fromBytes Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1BitString/ASN1BitString.fromBytes.html Creates an ASN1BitString from an encoded list of bytes. The first byte of the input `bytes` is interpreted as the number of unused bits in the last byte of the value. ```APIDOC ## ASN1BitString.fromBytes(Uint8List bytes) ### Description Creates an ASN1BitString from an encoded list of bytes. ### Parameters #### Path Parameters - **bytes** (Uint8List) - Required - The encoded list of bytes representing the ASN1BitString. ### Implementation Details This constructor initializes the `unusedbits` property with the first byte of the input `bytes` and the `stringValue` with the remaining bytes. ``` -------------------------------- ### ASN1OctetString Constructors Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1OctetString-class.html Constructors for creating an ASN1OctetString. You can initialize it with a String or a List, or from an encoded list of bytes. ```APIDOC ## ASN1OctetString Constructors ### ASN1OctetString(dynamic octets, {int tag = OCTET_STRING_TYPE}) Create an ASN1OctetString initialized with a String or a List. Optionally override the default ASN1 tag. ### ASN1OctetString.fromBytes(Uint8List bytes) Create an ASN1OctetString from an encoded list of bytes. ``` -------------------------------- ### ASN1Integer.fromInt Constructor Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Integer/ASN1Integer.fromInt.html This snippet shows the implementation of the ASN1Integer.fromInt constructor. It initializes the integer value and triggers the encoding process. ```dart ASN1Integer.fromInt(int x, {super.tag = INTEGER_TYPE}) { valueAsBigInteger = BigInt.from(x); _encode(); } ``` -------------------------------- ### ASN1Set.fromBytes Constructor Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Set/ASN1Set.fromBytes.html This snippet shows the implementation of the ASN1Set.fromBytes constructor. It validates that the provided bytes correspond to a set type before proceeding with decoding. ```dart ASN1Set.fromBytes( super.bytes ) : super.fromBytes() { if (!isSet(tag)) { throw ASN1Exception('The tag $tag does not look like a set type'); } _decodeSet(); } ``` -------------------------------- ### Define APPLICATION_CLASS Constant Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/APPLICATION_CLASS-constant.html Defines the APPLICATION_CLASS constant with a value of 0x40. This is a top-level constant. ```c const int APPLICATION_CLASS = 0x40; ``` -------------------------------- ### ASN1TeletextString Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1TeletextString/ASN1TeletextString.html Creates an ASN1TeletextString initialized with a String value. Optionally, you can override the tag. ```APIDOC ## ASN1TeletextString Constructor ### Description Creates an ASN1TeletextString initialized with a String value. Optionally, you can override the tag. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method Signature ```dart ASN1TeletextString(String stringValue, {int tag = UTF8_STRING_TYPE}) ``` ### Parameters - **stringValue** (String) - Required - The string value to initialize the ASN1TeletextString with. - **tag** (int) - Optional - The tag to override the default UTF8_STRING_TYPE. ### Implementation ```dart ASN1TeletextString(this.stringValue, {super.tag = UTF8_STRING_TYPE}); ``` ``` -------------------------------- ### ASN1UtcTime.fromBytes Constructor Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1UtcTime/ASN1UtcTime.fromBytes.html Constructs an ASN1UtcTime object by parsing a Uint8List of bytes. It handles the conversion of the ASN.1 UTC Time format (which uses a two-digit year and specific separators) into a standard DateTime object, including year prefixing and T separator insertion. ```APIDOC ## ASN1UtcTime.fromBytes constructor ### Description Creates an ASN1UtcTime from an encoded list of bytes. ### Parameters #### Path Parameters - **bytes** (Uint8List) - Required - The list of bytes representing the ASN.1 UTC Time. ### Implementation Details The constructor parses the byte value, decodes it to an ASCII string, adjusts the two-digit year to a four-digit year (assuming 19xx for years > 75 and 20xx otherwise), inserts a 'T' separator between the date and time, and then parses the resulting string into a DateTime object. ``` -------------------------------- ### ASN1Null.fromBytes Constructor Implementation Source: https://pub.dev/documentation/asn1lib/latest/asn1lib/ASN1Null/ASN1Null.fromBytes.html The ASN1Null.fromBytes constructor initializes the object with the provided byte list. ```dart ASN1Null.fromBytes(super.bytes) : super.fromBytes(); ```