Skip to main content

SshKeyInfo

Struct SshKeyInfo 

Source
pub struct SshKeyInfo {
Show 13 fields pub name: String, pub display_path: String, pub key_type: String, pub bits: String, pub fingerprint: String, pub comment: String, pub linked_hosts: Vec<String>, pub bishop_art: String, pub strength_score: u8, pub encrypted: bool, pub agent_loaded: bool, pub is_certificate: bool, pub mtime_ts: Option<u64>,
}
Expand description

Information about an SSH key found on disk.

Fields§

§name: String

Display name (filename without path, e.g. “id_ed25519”)

§display_path: String

Display path with tilde (e.g. “~/.ssh/id_ed25519”)

§key_type: String

Key type (e.g. “ED25519”, “RSA”, “sk-ED25519”)

§bits: String

Key bits (e.g. “256”, “4096”)

§fingerprint: String

SHA256 fingerprint

§comment: String

Comment from the public key

§linked_hosts: Vec<String>

Host aliases that reference this key via IdentityFile

§bishop_art: String

Drunken Bishop visual fingerprint from ssh-keygen -lv. 11 lines (top border + 9 content + bottom border), joined with \n. Empty when ssh-keygen returned no art block.

§strength_score: u8

Strength score 0..=100. Composed of algorithm strength, key size and on-disk encryption. Hardware-bound sk-* keys score highest; deprecated DSA and short RSA score lowest.

§encrypted: bool

Private key on disk is passphrase-encrypted. Detected via ssh-keygen -y -P "" -f <key> exit status. False when the private key is missing or unreadable.

§agent_loaded: bool

Public key fingerprint matches an entry returned by ssh-add -l.

§is_certificate: bool

File is an OpenSSH user certificate. Detected via -cert.pub filename suffix or a -cert substring in the ssh-keygen-reported key type (see detect_certificate).

§mtime_ts: Option<u64>

File mtime of the private key (or pubkey when private is missing), expressed as seconds since UNIX epoch. None when the file system cannot report a timestamp. Powers the Modified field on the Keys tab hero panel; mtime is the most portable proxy because birthtime is not exposed by every supported filesystem.

Implementations§

Source§

impl SshKeyInfo

Source

pub fn type_display(&self) -> String

Format type with bits (e.g. “ED25519” or “RSA 4096”).

Source

pub fn bishop_lines(&self) -> Vec<&str>

Drunken Bishop art split into rendering-ready lines. Empty Vec when bishop_art is empty (e.g. when ssh-keygen failed at discovery).

Trait Implementations§

Source§

impl Clone for SshKeyInfo

Source§

fn clone(&self) -> SshKeyInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SshKeyInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V