pub struct PublicKey {
pub key_type: String,
pub data: Vec<u8>,
pub comment: Option<String>,
}Expand description
A public key used for authentication.
Fields§
§key_type: StringThe key type (e.g., “ssh-ed25519”, “ssh-rsa”).
data: Vec<u8>The raw key data.
comment: Option<String>Optional comment from the authorized_keys file.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn with_comment(self, comment: impl Into<String>) -> Self
pub fn with_comment(self, comment: impl Into<String>) -> Self
Sets the comment for this key.
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Returns a fingerprint of the key.
Note: uses DefaultHasher (SipHash), not a cryptographic hash.
The prefix is for display convention only.
Trait Implementations§
impl Eq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.