#[non_exhaustive]
pub enum Fingerprint {
    Sha256([u8; 32]),
    Sha512([u8; 64]),
}
Expand description

SSH public key fingerprints.

Fingerprints have an associated key fingerprint algorithm, i.e. a hash function which is used to compute the fingerprint.

Parsing/serializing fingerprint strings

The FromStr and Display impls on Fingerprint can be used to parse and serialize fingerprints from the string format.

Example

SHA256:Nh0Me49Zh9fDw/VYUfq43IJmI1T+XrjiYONPND8GzaM

serde support

When the serde feature of this crate is enabled, this type receives impls of Deserialize and Serialize.

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

Sha256([u8; 32])

Fingerprints computed using SHA-256.

Sha512([u8; 64])

Fingerprints computed using SHA-512.

Implementations

Create a fingerprint of the given public key data using the provided hash algorithm.

Get the hash algorithm used for this fingerprint.

Get the raw digest output for the fingerprint as bytes.

Get the SHA-256 fingerprint, if this is one.

Get the SHA-512 fingerprint, if this is one.

Is this fingerprint SHA-256?

Is this fingerprint SHA-512?

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Formats the value using the given formatter. Read more
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.