pub enum TsigAlgorithm {
    HmacMd5,
    Gss,
    HmacSha1,
    HmacSha224,
    HmacSha256,
    HmacSha256_128,
    HmacSha384,
    HmacSha384_192,
    HmacSha512,
    HmacSha512_256,
    Unknown(Name),
}
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

Return DNS name for the algorithm

Write the Algorithm to the given encoder

Read the Algorithm from the given Encoder

Convert a DNS name to an Algorithm

Compute the Message Authentication Code using key and algorithm

Supported algorithm are HmacSha256, HmacSha384, HmacSha512 and HmacSha512_256 Other algorithm return an error.

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

Return length in bytes of the algorithms output

Return true if cryptographic operations needed for using this algorithm are supported, false otherwise

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more