Struct sshkeys::Fingerprint
source · [−]pub struct Fingerprint {
pub kind: FingerprintKind,
pub hash: String,
}
Expand description
A type that represents an OpenSSH public key fingerprint.
Fields
kind: FingerprintKind
The kind used to represent the fingerprint.
hash: String
The computed fingerprint.
Implementations
sourceimpl Fingerprint
impl Fingerprint
sourcepub fn compute<T: ?Sized + AsRef<[u8]>>(
kind: FingerprintKind,
data: &T
) -> Fingerprint
pub fn compute<T: ?Sized + AsRef<[u8]>>(
kind: FingerprintKind,
data: &T
) -> Fingerprint
Computes the fingerprint of a byte sequence using a given fingerprint representation.
This method computes a fingerprint the way OpenSSH does it and is generally being used to compute the fingerprint of an already encoded OpenSSH public key.
Example
let fp = sshkeys::Fingerprint::compute(sshkeys::FingerprintKind::Sha256, "some data".as_bytes());
assert_eq!(fp.kind, sshkeys::FingerprintKind::Sha256);
assert_eq!(fp.hash, "EweZDmulyhRes16ZGCqb7EZTG8VN32VqYCx4D6AkDe4");
Trait Implementations
sourceimpl Debug for Fingerprint
impl Debug for Fingerprint
Auto Trait Implementations
impl RefUnwindSafe for Fingerprint
impl Send for Fingerprint
impl Sync for Fingerprint
impl Unpin for Fingerprint
impl UnwindSafe for Fingerprint
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more