Struct sshcerts::ssh::Fingerprint [−][src]
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]
impl Fingerprint
[src]pub fn compute<T: ?Sized + AsRef<[u8]>>(
kind: FingerprintKind,
data: &T
) -> Fingerprint
[src]
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 = Fingerprint::compute(FingerprintKind::Sha256, "some data".as_bytes()); assert_eq!(fp.kind, FingerprintKind::Sha256); assert_eq!(fp.hash, "EweZDmulyhRes16ZGCqb7EZTG8VN32VqYCx4D6AkDe4");
Trait Implementations
impl PartialEq<Fingerprint> for Fingerprint
[src]
impl PartialEq<Fingerprint> for Fingerprint
[src]fn eq(&self, other: &Fingerprint) -> bool
[src]
fn ne(&self, other: &Fingerprint) -> bool
[src]
impl StructuralPartialEq for Fingerprint
[src]
impl StructuralPartialEq for Fingerprint
[src]Auto Trait Implementations
impl RefUnwindSafe for Fingerprint
impl RefUnwindSafe for Fingerprint
impl Send for Fingerprint
impl Send for Fingerprint
impl Sync for Fingerprint
impl Sync for Fingerprint
impl Unpin for Fingerprint
impl Unpin for Fingerprint
impl UnwindSafe for Fingerprint
impl UnwindSafe for Fingerprint