OpenSshPublicKey class Null safety
Represents the OpenSSH Public Key format.
This format supports a single optional comment, but no other properties.
The text encoding consists of a single line containing: the key-type, base-64 encoded binary representation, and an optional comment.
The binary representation contains a number of chunks of data, depending on the encryption algorithm. The first chunk is always a duplicate copy of the key-type.
This class is used for the binary representation of both this OpenSSH public key format and the bit string inside of the SSH Public Key File Format. The SshPublicKey class implements the encoding and decoding of that second format.
Example
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJnryCPo8...a1Ad user@example.com
This is a proprietary format. It is largely undocumented, except partially in the "Authorized_keys file format" section of OpenSSH's sshd man page.
This implementation does not support options. It will fail to decode lines that contain public keys with options.
- Implemented types
Constructors
- OpenSshPublicKey(Uint8List data, [String? comment, PubTextSource? source])
- Construct an OpenSSH public key. [...]
- OpenSshPublicKey.decode(String str, {int offset = 0})
- Decode from text [...]
Properties
- comment ↔ String?
-
Comment [...]
read / write
- data ↔ Uint8List
-
Binary data representing the public key.
read / write
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- source ↔ PubTextSource?
-
Source text the OpenSSH public key was parsed from. [...]
read / write
Methods
-
encode(
) → String -
Encode as text. [...]
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
A string representation of this object. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited