Enum trust_dns_proto::rr::dnssec::rdata::tsig::TsigAlgorithm
source · pub enum TsigAlgorithm {
HmacMd5,
Gss,
HmacSha1,
HmacSha224,
HmacSha256,
HmacSha256_128,
HmacSha384,
HmacSha384_192,
HmacSha512,
HmacSha512_256,
Unknown(Name),
}
dnssec
only.Expand description
Algorithm used to authenticate communication
RFC8945 Secret Key Transaction Authentication for DNS
+==========================+================+=================+
| Algorithm Name | Implementation | Use |
+==========================+================+=================+
| HMAC-MD5.SIG-ALG.REG.INT | MAY | MUST NOT |
+--------------------------+----------------+-----------------+
| gss-tsig | MAY | MAY |
+--------------------------+----------------+-----------------+
| hmac-sha1 | MUST | NOT RECOMMENDED |
+--------------------------+----------------+-----------------+
| hmac-sha224 | MAY | MAY |
+--------------------------+----------------+-----------------+
| hmac-sha256 | MUST | RECOMMENDED |
+--------------------------+----------------+-----------------+
| hmac-sha256-128 | MAY | MAY |
+--------------------------+----------------+-----------------+
| hmac-sha384 | MAY | MAY |
+--------------------------+----------------+-----------------+
| hmac-sha384-192 | MAY | MAY |
+--------------------------+----------------+-----------------+
| hmac-sha512 | MAY | MAY |
+--------------------------+----------------+-----------------+
| hmac-sha512-256 | MAY | MAY |
+--------------------------+----------------+-----------------+
Variants§
HmacMd5
HMAC-MD5.SIG-ALG.REG.INT (not supported for cryptographic operations)
Gss
gss-tsig (not supported for cryptographic operations)
HmacSha1
hmac-sha1 (not supported for cryptographic operations)
HmacSha224
hmac-sha224 (not supported for cryptographic operations)
HmacSha256
hmac-sha256
HmacSha256_128
hmac-sha256-128 (not supported for cryptographic operations)
HmacSha384
hmac-sha384
HmacSha384_192
hmac-sha384-192 (not supported for cryptographic operations)
HmacSha512
hmac-sha512
HmacSha512_256
hmac-sha512-256 (not supported for cryptographic operations)
Unknown(Name)
Unkown algorithm
Implementations§
source§impl TsigAlgorithm
impl TsigAlgorithm
sourcepub fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>
pub fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>
Write the Algorithm to the given encoder
sourcepub fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>
pub fn read(decoder: &mut BinDecoder<'_>) -> ProtoResult<Self>
Read the Algorithm from the given Encoder
sourcepub fn mac_data(&self, key: &[u8], message: &[u8]) -> ProtoResult<Vec<u8>>
Available on crate feature ring
only.
pub fn mac_data(&self, key: &[u8], message: &[u8]) -> ProtoResult<Vec<u8>>
ring
only.Compute the Message Authentication Code using key and algorithm
Supported algorithm are HmacSha256, HmacSha384, HmacSha512 and HmacSha512_256 Other algorithm return an error.
sourcepub fn verify_mac(
&self,
key: &[u8],
message: &[u8],
tag: &[u8]
) -> ProtoResult<()>
Available on crate feature ring
only.
pub fn verify_mac( &self, key: &[u8], message: &[u8], tag: &[u8] ) -> ProtoResult<()>
ring
only.Verifies the hmac tag against the given key and this algorithm.
This is both faster than independently creating the MAC and also constant time preventing timing attacks
sourcepub fn output_len(&self) -> ProtoResult<usize>
Available on crate feature ring
only.
pub fn output_len(&self) -> ProtoResult<usize>
ring
only.Return length in bytes of the algorithms output
Trait Implementations§
source§impl Clone for TsigAlgorithm
impl Clone for TsigAlgorithm
source§fn clone(&self) -> TsigAlgorithm
fn clone(&self) -> TsigAlgorithm
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TsigAlgorithm
impl Debug for TsigAlgorithm
source§impl<'de> Deserialize<'de> for TsigAlgorithm
impl<'de> Deserialize<'de> for TsigAlgorithm
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>,
source§impl Display for TsigAlgorithm
impl Display for TsigAlgorithm
source§impl Hash for TsigAlgorithm
impl Hash for TsigAlgorithm
source§impl PartialEq for TsigAlgorithm
impl PartialEq for TsigAlgorithm
source§fn eq(&self, other: &TsigAlgorithm) -> bool
fn eq(&self, other: &TsigAlgorithm) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for TsigAlgorithm
impl Serialize for TsigAlgorithm
impl Eq for TsigAlgorithm
impl StructuralEq for TsigAlgorithm
impl StructuralPartialEq for TsigAlgorithm
Auto Trait Implementations§
impl RefUnwindSafe for TsigAlgorithm
impl Send for TsigAlgorithm
impl Sync for TsigAlgorithm
impl Unpin for TsigAlgorithm
impl UnwindSafe for TsigAlgorithm
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
§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
§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
key
and return true
if they are equal.