Enum sequoia_openpgp::types::HashAlgorithm [−][src]
#[non_exhaustive] pub enum HashAlgorithm { MD5, SHA1, RipeMD, SHA256, SHA384, SHA512, SHA224, Private(u8), Unknown(u8), }
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)
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
impl HashAlgorithm
[src]
impl HashAlgorithm
[src]pub fn is_supported(self) -> bool
[src]
pub fn is_supported(self) -> bool
[src]Whether Sequoia supports this algorithm.
impl HashAlgorithm
[src]
impl HashAlgorithm
[src]impl HashAlgorithm
[src]
impl HashAlgorithm
[src]pub fn text_name(&self) -> Result<&str>
[src]
pub fn text_name(&self) -> Result<&str>
[src]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
impl Clone for HashAlgorithm
[src]
impl Clone for HashAlgorithm
[src]fn clone(&self) -> HashAlgorithm
[src]
fn clone(&self) -> HashAlgorithm
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for HashAlgorithm
[src]
impl Debug for HashAlgorithm
[src]impl Default for HashAlgorithm
[src]
impl Default for HashAlgorithm
[src]impl Display for HashAlgorithm
[src]
impl Display for HashAlgorithm
[src]impl FromStr for HashAlgorithm
[src]
impl FromStr for HashAlgorithm
[src]impl Hash for HashAlgorithm
[src]
impl Hash for HashAlgorithm
[src]impl Ord for HashAlgorithm
[src]
impl Ord for HashAlgorithm
[src]impl PartialEq<HashAlgorithm> for HashAlgorithm
[src]
impl PartialEq<HashAlgorithm> for HashAlgorithm
[src]fn eq(&self, other: &HashAlgorithm) -> bool
[src]
fn eq(&self, other: &HashAlgorithm) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &HashAlgorithm) -> bool
[src]
fn ne(&self, other: &HashAlgorithm) -> bool
[src]This method tests for !=
.
impl PartialOrd<HashAlgorithm> for HashAlgorithm
[src]
impl PartialOrd<HashAlgorithm> for HashAlgorithm
[src]fn partial_cmp(&self, other: &HashAlgorithm) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &HashAlgorithm) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for HashAlgorithm
[src]
impl Eq for HashAlgorithm
[src]
impl StructuralEq for HashAlgorithm
[src]
impl StructuralPartialEq for HashAlgorithm
[src]
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
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more