Enum trust_dns_proto::rr::dnssec::DigestType
source · #[non_exhaustive]pub enum DigestType {
SHA1,
SHA256,
GOSTR34_11_94,
SHA384,
SHA512,
ED25519,
}
Available on crate feature
dnssec
only.Expand description
This is the digest format for the
0 Reserved - [RFC3658]
1 SHA-1 MANDATORY [RFC3658]
2 SHA-256 MANDATORY [RFC4509]
3 GOST R 34.11-94 OPTIONAL [RFC5933]
4 SHA-384 OPTIONAL [RFC6605]
5 ED25519 [RFC draft-ietf-curdle-dnskey-eddsa-03]
5-255 Unassigned -
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.
SHA1
SHA256
GOSTR34_11_94
SHA384
SHA512
Undefined
ED25519
This is a passthrough digest as ED25519 is self-packaged
Implementations§
source§impl DigestType
impl DigestType
sourcepub fn from_u8(value: u8) -> ProtoResult<Self>
pub fn from_u8(value: u8) -> ProtoResult<Self>
TODO: add an Unknown DigestType and make this infallible http://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml
sourcepub fn to_openssl_digest(self) -> ProtoResult<MessageDigest>
Available on crate feature openssl
only.
pub fn to_openssl_digest(self) -> ProtoResult<MessageDigest>
openssl
only.The OpenSSL counterpart for the digest
sourcepub fn to_ring_digest_alg(self) -> ProtoResult<&'static Algorithm>
Available on crate feature ring
only.
pub fn to_ring_digest_alg(self) -> ProtoResult<&'static Algorithm>
ring
only.The ring counterpart for the digest
sourcepub fn hash(self, data: &[u8]) -> ProtoResult<Digest>
Available on crate feature ring
only.
pub fn hash(self, data: &[u8]) -> ProtoResult<Digest>
ring
only.Hash the data
sourcepub fn digest_all(self, data: &[&[u8]]) -> ProtoResult<Digest>
Available on crate feature ring
only.
pub fn digest_all(self, data: &[&[u8]]) -> ProtoResult<Digest>
ring
only.Digest all the data.
Trait Implementations§
source§impl Clone for DigestType
impl Clone for DigestType
source§fn clone(&self) -> DigestType
fn clone(&self) -> DigestType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DigestType
impl Debug for DigestType
source§impl<'de> Deserialize<'de> for DigestType
impl<'de> Deserialize<'de> for DigestType
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Algorithm> for DigestType
impl From<Algorithm> for DigestType
source§impl From<DigestType> for u8
impl From<DigestType> for u8
source§fn from(a: DigestType) -> Self
fn from(a: DigestType) -> Self
Converts to this type from the input type.
source§impl Hash for DigestType
impl Hash for DigestType
source§impl Ord for DigestType
impl Ord for DigestType
source§fn cmp(&self, other: &DigestType) -> Ordering
fn cmp(&self, other: &DigestType) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for DigestType
impl PartialEq for DigestType
source§fn eq(&self, other: &DigestType) -> bool
fn eq(&self, other: &DigestType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for DigestType
impl PartialOrd for DigestType
source§fn partial_cmp(&self, other: &DigestType) -> Option<Ordering>
fn partial_cmp(&self, other: &DigestType) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for DigestType
impl Serialize for DigestType
impl Copy for DigestType
impl Eq for DigestType
impl StructuralEq for DigestType
impl StructuralPartialEq for DigestType
Auto Trait Implementations§
impl RefUnwindSafe for DigestType
impl Send for DigestType
impl Sync for DigestType
impl Unpin for DigestType
impl UnwindSafe for DigestType
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.