[][src]Struct sshkeys::Fingerprint

pub struct Fingerprint {
    pub kind: FingerprintKind,
    pub hash: String,
}

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

impl Fingerprint[src]

pub fn compute<T: ?Sized + AsRef<[u8]>>(
    kind: FingerprintKind,
    data: &T
) -> Fingerprint
[src]

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

impl Debug for Fingerprint[src]

impl Display for Fingerprint[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.