DnsTsigKey Class
A secret shared with a DNS server, used to sign the queries and to authenticate the responses with TSIG (RFC 8945). Set it in DnsClientOptions.TsigKey.
public sealed class DnsTsigKeyConstructors
| Name | Description |
|---|---|
| DnsTsigKey(string, DnsTsigAlgorithm, ReadOnlySpan<byte>) | Initializes a new instance of the DnsTsigKey class. |
DnsTsigKey(string, DnsTsigAlgorithm, ReadOnlySpan<byte>)
DnsTsigKey.csInitializes a new instance of the DnsTsigKey class.
public DnsTsigKey(string name, DnsTsigAlgorithm algorithm, ReadOnlySpan<byte> secret)Parameters
namestring- The name of the key, as configured on the server (for instance
transfer-key). algorithmDnsTsigAlgorithm- The HMAC algorithm of the key.
secretReadOnlySpan<byte>- The secret. Key files store it in base64: decode it with
Convert.FromBase64String.
Exceptions
ArgumentExceptionnameis not a valid domain name, orsecretis empty.ArgumentOutOfRangeExceptionalgorithmis not a defined value.
Properties
| Name | Description |
|---|---|
| Algorithm | Gets the HMAC algorithm of the key. |
| Fudge | Gets the clock difference allowed between the client and the server. A response signed further from the current time is rejected, and the server applies the same window to the queries. Default is 5 minutes, the value RFC 8945 recommends. |
| Name | Gets the name of the key. |
Algorithm
DnsTsigKey.csFudge
DnsTsigKey.csGets the clock difference allowed between the client and the server. A response signed further from the current time is rejected, and the server applies the same window to the queries. Default is 5 minutes, the value RFC 8945 recommends.
public TimeSpan Fudge { get; init; }Property value
Exceptions
ArgumentOutOfRangeException- The value is negative, longer than 65535 seconds, or not a whole number of seconds.