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<'_>) -> Result<(), ProtoError>
pub fn emit(&self, encoder: &mut BinEncoder<'_>) -> Result<(), ProtoError>
Write the Algorithm to the given encoder
Sourcepub fn read(decoder: &mut BinDecoder<'_>) -> Result<Self, ProtoError>
pub fn read(decoder: &mut BinDecoder<'_>) -> Result<Self, ProtoError>
Read the Algorithm from the given Encoder
Sourcepub fn mac_data(
&self,
key: &[u8],
message: &[u8],
) -> Result<Vec<u8>, ProtoError>
Available on crate feature dnssec-ring
only.
pub fn mac_data( &self, key: &[u8], message: &[u8], ) -> Result<Vec<u8>, ProtoError>
dnssec-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],
) -> Result<(), ProtoError>
Available on crate feature dnssec-ring
only.
pub fn verify_mac( &self, key: &[u8], message: &[u8], tag: &[u8], ) -> Result<(), ProtoError>
dnssec-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) -> Result<usize, ProtoError>
Available on crate feature dnssec-ring
only.
pub fn output_len(&self) -> Result<usize, ProtoError>
dnssec-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§impl Serialize for TsigAlgorithm
impl Serialize for TsigAlgorithm
impl Eq for TsigAlgorithm
impl StructuralPartialEq for TsigAlgorithm
Auto Trait Implementations§
impl Freeze for TsigAlgorithm
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.