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§
source§impl 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§
source§impl Debug for Fingerprint
impl Debug 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 UnwindSafe for Fingerprint
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