OpenSshPublicKey class

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
getter/setter pair
data Uint8List
Binary data representing the public key.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
keyType String
Type of key
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source PubTextSource?
Source text the OpenSSH public key was parsed from.
getter/setter pair

Methods

encode() String
Encode as text.
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