pub enum DigestAlgorithm {
Sha1,
Sha256,
Sha384,
Sha512,
}
Expand description
A hashing algorithm used for digesting data.
Instances can be converted to and from Oid via From
/Into
implementations.
They can also be converted to and from The ASN.1 AlgorithmIdentifier, which is commonly used to represent them in X.509 certificates.
Instances can be converted into a [digest::Context] capable of computing
digests via From
/Into
.
Variants§
Sha1
SHA-1.
Corresponds to OID 1.3.14.3.2.26.
Sha256
SHA-256.
Corresponds to OID 2.16.840.1.101.3.4.2.1.
Sha384
SHA-384.
Corresponds to OID 2.16.840.1.101.3.4.2.2.
Sha512
SHA-512.
Corresponds to OID 2.16.840.1.101.3.4.2.3.
Trait Implementations§
Source§impl Clone for DigestAlgorithm
impl Clone for DigestAlgorithm
Source§fn clone(&self) -> DigestAlgorithm
fn clone(&self) -> DigestAlgorithm
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DigestAlgorithm
impl Debug for DigestAlgorithm
Source§impl Display for DigestAlgorithm
impl Display for DigestAlgorithm
Source§impl From<DigestAlgorithm> for AlgorithmIdentifier
impl From<DigestAlgorithm> for AlgorithmIdentifier
Source§fn from(alg: DigestAlgorithm) -> Self
fn from(alg: DigestAlgorithm) -> Self
Converts to this type from the input type.
Source§impl From<DigestAlgorithm> for Oid
impl From<DigestAlgorithm> for Oid
Source§fn from(alg: DigestAlgorithm) -> Oid
fn from(alg: DigestAlgorithm) -> Oid
Converts to this type from the input type.
Source§impl Hash for DigestAlgorithm
impl Hash for DigestAlgorithm
Source§impl PartialEq for DigestAlgorithm
impl PartialEq for DigestAlgorithm
Source§impl TryFrom<&AlgorithmIdentifier> for DigestAlgorithm
impl TryFrom<&AlgorithmIdentifier> for DigestAlgorithm
Source§type Error = X509CertificateError
type Error = X509CertificateError
The type returned in the event of a conversion error.
Source§impl TryFrom<&Oid> for DigestAlgorithm
impl TryFrom<&Oid> for DigestAlgorithm
impl Copy for DigestAlgorithm
impl Eq for DigestAlgorithm
impl StructuralPartialEq for DigestAlgorithm
Auto Trait Implementations§
impl Freeze for DigestAlgorithm
impl RefUnwindSafe for DigestAlgorithm
impl Send for DigestAlgorithm
impl Sync for DigestAlgorithm
impl Unpin for DigestAlgorithm
impl UnwindSafe for DigestAlgorithm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more