pub struct Fingerprint(/* private fields */);Expand description
An OpenSSH SHA256:<base64> public key fingerprint.
This is exactly what ssh-keygen -lf prints and what OpenSSH shows on an
unknown-host prompt: unpadded base64 of the sha256 of the wire encoding.
gunnar never computes “something like” a fingerprint. An operator has to be
able to compare what gunnar lists against what ssh-keygen says on their
laptop, so tests/fingerprint.rs pins it to known answers taken from the
real OpenSSH binary.
Every constructor routes through fingerprint_of_blob, so there is one
definition and it is a definition over bytes.
Implementations§
Source§impl Fingerprint
impl Fingerprint
Sourcepub fn of_key(key: &PublicKey) -> Self
pub fn of_key(key: &PublicKey) -> Self
Fingerprint a parsed key.
Convenience over fingerprint_of_blob for the crates that link this
ssh-key. gunnar-ssh cannot use it (see fingerprint_of_blob) and
calls that function with russh’s key blob instead.
Sourcepub fn of_openssh(line: &str) -> Result<Self>
pub fn of_openssh(line: &str) -> Result<Self>
Parse an authorized_keys-style line and fingerprint it.
Accepts what OpenSSH writes: <algo> <base64> [comment].
Sourcepub fn parse(text: &str) -> Result<Self>
pub fn parse(text: &str) -> Result<Self>
Accept a fingerprint that arrived as text: config file, gRPC request, an operator’s terminal.
Validated rather than trusted: SHA256: plus 43 base64 characters. A
malformed fingerprint that gets stored anyway is a key that can never be
matched and never be revoked.
Trait Implementations§
Source§impl Clone for Fingerprint
impl Clone for Fingerprint
Source§impl Debug for Fingerprint
impl Debug for Fingerprint
Source§impl<'de> Deserialize<'de> for Fingerprint
impl<'de> Deserialize<'de> for Fingerprint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for Fingerprint
impl Display for Fingerprint
impl Eq for Fingerprint
Source§impl FromStr for Fingerprint
impl FromStr for Fingerprint
Source§impl Hash for Fingerprint
impl Hash for Fingerprint
Source§impl Ord for Fingerprint
impl Ord for Fingerprint
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Fingerprint
impl PartialEq for Fingerprint
Source§impl PartialOrd for Fingerprint
impl PartialOrd for Fingerprint
Source§impl Serialize for Fingerprint
impl Serialize for Fingerprint
impl StructuralPartialEq for Fingerprint
Auto Trait Implementations§
impl Freeze for Fingerprint
impl RefUnwindSafe for Fingerprint
impl Send for Fingerprint
impl Sync for Fingerprint
impl Unpin for Fingerprint
impl UnsafeUnpin for Fingerprint
impl UnwindSafe for Fingerprint
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.