Enum sequoia_openpgp::types::HashAlgorithm [−][src]
#[non_exhaustive] pub enum HashAlgorithm { MD5, SHA1, RipeMD, SHA256, SHA384, SHA512, SHA224, Private(u8), Unknown(u8), }
Expand description
The OpenPGP hash algorithms as defined in Section 9.4 of RFC 4880.
Note: This enum cannot be exhaustively matched to allow future extensions.
Examples
Use HashAlgorithm
to set the preferred hash algorithms on a signature:
use sequoia_openpgp as openpgp; use openpgp::packet::signature::SignatureBuilder; use openpgp::types::{HashAlgorithm, SignatureType}; let mut builder = SignatureBuilder::new(SignatureType::DirectKey) .set_hash_algo(HashAlgorithm::SHA512);
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Rivest et.al. message digest 5.
NIST Secure Hash Algorithm (deprecated)
RIPEMD-160
256-bit version of SHA2
384-bit version of SHA2
512-bit version of SHA2
224-bit version of SHA2
Private(u8)
Private hash algorithm identifier.
Unknown(u8)
Unknown hash algorithm identifier.
Implementations
Whether Sequoia supports this algorithm.
Returns the text name of this algorithm.
Section 9.4 of RFC 4880 defines a textual representation of hash algorithms. This is used in cleartext signed messages (see Section 7 of RFC 4880).
Examples
assert_eq!(HashAlgorithm::RipeMD.text_name()?, "RIPEMD160");
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
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
Auto Trait Implementations
impl RefUnwindSafe for HashAlgorithm
impl Send for HashAlgorithm
impl Sync for HashAlgorithm
impl Unpin for HashAlgorithm
impl UnwindSafe for HashAlgorithm
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self