pub enum HashFunc {
Sha1,
Sha224,
Sha256,
Sha384,
Sha512,
}Expand description
The hash a fingerprint was taken with (RFC 8122 §5).
MD2 and MD5 are deliberately absent. §5: implementations “MUST NOT use the MD2 and MD5 hash functions to calculate fingerprints or to verify received fingerprints that have been calculated using them”. A parser that accepted them would be offering a caller a value it is forbidden to act on, so they are rejected at the door instead.
Variants§
Sha1
SHA-1. Accepted for interoperability with peers that still send it; not what sipx offers.
Sha224
SHA-224.
Sha256
SHA-256 — §5’s preferred function, and what sipx sends.
Sha384
SHA-384.
Sha512
SHA-512.
Implementations§
Source§impl HashFunc
impl HashFunc
Sourcepub fn parse(token: &str) -> Option<Self>
pub fn parse(token: &str) -> Option<Self>
The function a token names, if it is one that may be used.
Case-insensitive: §5’s grammar makes hash-func a token, and RFC 8866 §5 does not fix the
case of attribute values. md5 and md2 parse to None — the grammar allows them and §5
forbids acting on them, and returning None is how that prohibition is expressed here.
Sourcepub fn digest_len(self) -> usize
pub fn digest_len(self) -> usize
How many octets the digest has.