ASN1OctetString class
An ASN1 Octet String. This is an array of character codes.
WARNING: The constructor ASN1OctetString(String)
will encode the string
as UTF-8 octets. This is not different than Dart's UTF-16 encoding scheme.
If you need a different encoding, you should encode the string as a Uint8List yourself and pass that to the constructor.
- Inheritance
-
- Object
- ASN1Object
- ASN1OctetString
- Implementers
Constructors
- ASN1OctetString.new(dynamic octets, {int tag = OCTET_STRING_TYPE})
- Create an ASN1OctetString initialized with a String or a List<int>. Optionally override the default ASN1 tag
- ASN1OctetString.fromBytes(Uint8List bytes)
- Create an ASN1OctetString from an encoded list of bytes.
Properties
- encodedBytes → Uint8List
-
Get the encoded byte representation for this object. This can trigger
calling the subclasss
_encode
method if the object has not yet been encodedno setterinherited - extendedTag → int?
-
no setterinherited
- hasExtendedTag → bool
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEncoded → bool
-
Check if the encoding is ready.
no setterinherited
- octets ↔ Uint8List
-
The decoded string value
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringValue → String
-
Get the String value of this octet string.
Note this uses Dart's default decoding of bytes to String (UTF-16).
Be careful with this method as it may not be the correct encoding for
your purposes.
@deprecated use utf8StringValue or utf16StringValue instead
no setter
- tag → int
-
The BER tag representing this object
finalinherited
- totalEncodedByteLength → int
-
The total length of this object in bytes - including its value
bytes and the encoded tag and length bytes.
no setterinherited
- utf16StringValue → String
-
no setter
- utf8StringValue → String
-
get the String value assuming utf-8 encoding of the octet bytes.
UTF-8 is a common encoding for ldap servers
no setter
Methods
-
contentBytes(
) → Uint8List -
Returns the real content of a tag. This might be equal to valueBytes for some tags.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toHexString(
) → String -
inherited
-
toString(
) → String -
A string representation of this object.
override
-
valueBytes(
) → Uint8List -
Return just the value bytes.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited