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
sourceimpl 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>>
This is supported 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<()>
This is supported 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>
This is supported on crate feature ring
only.
pub fn output_len(&self) -> ProtoResult<usize>
ring
only.Return length in bytes of the algorithms output
Trait Implementations
sourceimpl Clone for TsigAlgorithm
impl Clone for TsigAlgorithm
sourcefn clone(&self) -> TsigAlgorithm
fn clone(&self) -> TsigAlgorithm
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TsigAlgorithm
impl Debug for TsigAlgorithm
sourceimpl<'de> Deserialize<'de> for TsigAlgorithm
impl<'de> Deserialize<'de> for TsigAlgorithm
sourcefn 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
sourceimpl Display for TsigAlgorithm
impl Display for TsigAlgorithm
sourceimpl Hash for TsigAlgorithm
impl Hash for TsigAlgorithm
sourceimpl PartialEq<TsigAlgorithm> for TsigAlgorithm
impl PartialEq<TsigAlgorithm> for TsigAlgorithm
sourcefn eq(&self, other: &TsigAlgorithm) -> bool
fn eq(&self, other: &TsigAlgorithm) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &TsigAlgorithm) -> bool
fn ne(&self, other: &TsigAlgorithm) -> bool
This method tests for !=
.
sourceimpl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more