ReadonlydataThe parsed key material by algorithm.
ReadonlycommentThe comment field of the OpenSSH text form (may be empty).
Algorithm tag for this key.
Algorithm-specific raw payload bytes. Throws for DSA and RSA, whose
keys are several integers — use data.p/q/g/y or data.e/n instead.
Staticed25519An Ed25519 key from its 32 raw bytes.
StaticecdsaA P-256 key from its 65-byte SEC1 uncompressed point.
StaticecdsaA P-384 key from its 97-byte SEC1 uncompressed point.
StaticecdsaA P-521 key from its 133-byte SEC1 uncompressed point.
StaticecdsaAn ECDSA key on curve from its SEC1 uncompressed point.
StaticdsaDSA public key. p/q/g/y must already be canonical positive bytes (no sign byte).
StaticrsaRSA public key. e and n must already be canonical positive bytes (no sign byte).
Returns a copy of this SSH public key with the comment replaced, leaving this instance untouched.
StaticfromParses the single-line OpenSSH text form (<algorithm> <base64 blob> [comment])
as ssh-key 0.6.7 PublicKey::from_openssh: trailing whitespace is
removed, the algorithm and Base64 segments end at a single space, the
Base64 is strict, and the text's algorithm name must equal the blob's
(unknown algorithm otherwise).
The single-line OpenSSH text form.
StaticfromParses the binary key blob (the base64 payload of the text form).
The binary key blob, byte for byte as OpenSSH writes it.
SHA-256 of the OpenSSH text form (the reference's Reference image).
The first four bytes of digest() in hex, the reference's ref_hex_short.
SSHPublicKey(<short reference>), the reference's Display.
true when algorithm, key material and comment are all equal.
Comment-insensitive equality: matches when algorithm and key data agree, ignoring the comment. Used by verify paths since SSH wire-format pubkey blobs carry the key but not the comment.
Verifies an sshsig signature made over message in namespace, as
ssh_key::PublicKey::verify: the embedded key must be this key, the
namespace must match, and the algorithm-specific signature must verify
over the signed-data blob. Never throws on malformed input.
SSH key/signature/certificate types — Ed25519, DSA, RSA and ECDSA P-256 / P-384 / P-521 over the OpenSSH text and binary formats.