TextualEncoding class

Textual encoding

Implementation of the "textual encoding" defined by RFC 7468. This format is a method of representing binary data as text.

As RFC 7468 puts it, "for reasons that basically boil down to non-coordination or inattention, many PKIX, PKCS, and CMS libraries implement a text-based encoding that is similar to -- but not identical with --- PEM encoding. The RFC 7468 specifies a textual encoding format that articulates the de facto rules that most implementations operate by."

This encoding begins with a line that says "-----BEGIN label-----" and ends with "-----END label-----" with base-64 encoded data between them.

Note: unlike the proprietary OpenSSH public key format or the RFC 4716 'SSH Public Key File Format", this format does not support a comment and/or headers.

Example

This example has "RSA PUBLIC KEY" as the label.

-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEAyZ68gj6PPgga0C+1NbI2o/+ArLmh98fuKKH3wfHSsSQMOifg0ENO
ODUKDXdXDRepILtu2mjwvnr1mg48NP3b+Gxrp8od6Nz1pLrT6b01KbS1lsSn8V5l
EFK1+T5OXlxer+S0PUzaHlGwXRPdv0H7UqkBUd5xcFdpZvW0ARTk0CwRkrHI2uut
+nGiEH1fJWICcn4OCD2ZzbTGBBsTsxfSmQju6T7DIfuCbPBR49YKoPUYtaRcmSzS
JYA0bVANqmPhQ9xUQtKHwYSPFe1Q1VKC83x33na2os8LFGzGVb0rQthkqK8vM5jz
KfnpggTiElJr08KHgvpx4A1t7yg2rmtQHQIDAQAB
-----END RSA PUBLIC KEY-----
Implemented types

Constructors

TextualEncoding(String label, Uint8List data)
Creates a textual encoding from values.
TextualEncoding.decode(String str, {int offset = 0, bool allowPreamble = false})
Decode from text.

Properties

data Uint8List
The encapsulated binary data.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
label String
The label for the textual encoding.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source TextSource?
Source this was decoded from.
getter/setter pair

Methods

encode() String
Text encoding of the label and data.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited