pub struct Tsig<Octets, Name> { /* private fields */ }
Implementations§
source§impl<O, N> Tsig<O, N>
impl<O, N> Tsig<O, N>
sourcepub fn new(
algorithm: N,
time_signed: Time48,
fudge: u16,
mac: O,
original_id: u16,
error: TsigRcode,
other: O
) -> Self
pub fn new( algorithm: N, time_signed: Time48, fudge: u16, mac: O, original_id: u16, error: TsigRcode, other: O ) -> Self
Creates a new TSIG record from its components.
See the access methods for an explanation of these components.
Panics
Since time_signed
is actually a 48 bit integer, the function will
panic of the upper 16 bits are not all 0.
sourcepub fn algorithm(&self) -> &N
pub fn algorithm(&self) -> &N
Returns a reference to the algorithm name.
TSIG encodes the algorithm used for keys and signatures as a domain name. It does, however, only use the format. No structure is used at all.
sourcepub fn time_signed(&self) -> Time48
pub fn time_signed(&self) -> Time48
Returns the Unix time when the signature is created.
Despite its type, this is actually a 48 bit number. The upper 16 bits will never be set.
sourcepub fn fudge(&self) -> u16
pub fn fudge(&self) -> u16
Return the number of seconds of offset from signing time permitted.
When a signature is checked, the local system time needs to be within
this many seconds from time_signed
to be accepted.
sourcepub fn mac_slice(&self) -> &[u8] ⓘwhere
O: AsRef<[u8]>,
pub fn mac_slice(&self) -> &[u8] ⓘwhere O: AsRef<[u8]>,
Returns an octet slice containing the MAC.
sourcepub fn original_id(&self) -> u16
pub fn original_id(&self) -> u16
Returns the original message ID.
Since the message ID is part of the signature generation but may be changed for a forwarded message, it is included in the TSIG record.
sourcepub fn other(&self) -> &O
pub fn other(&self) -> &O
Returns a reference to the other bytes.
This field is only used for BADTIME errors to return the server time. Otherwise it is empty.
sourcepub fn other_time(&self) -> Option<Time48>where
O: AsRef<[u8]>,
pub fn other_time(&self) -> Option<Time48>where O: AsRef<[u8]>,
Returns the other bytes as the server time.
If the other bytes field is exactly 6 bytes long, this methods
returns it as a u64
representation of the Unix time contained.
sourcepub fn is_valid_now(&self) -> bool
pub fn is_valid_now(&self) -> bool
Returns whether the record is valid right now.
The method checks whether the current system time is within fudge
seconds of the time_signed
.
source§impl<Ref> Tsig<Ref::Range, ParsedDname<Ref>>where
Ref: OctetsRef,
impl<Ref> Tsig<Ref::Range, ParsedDname<Ref>>where Ref: OctetsRef,
pub fn flatten_into<Octets>( self ) -> Result<Tsig<Octets, Dname<Octets>>, PushError>where Octets: OctetsFrom<Ref::Range> + FromBuilder, <Octets as FromBuilder>::Builder: EmptyBuilder,
Trait Implementations§
source§impl<O, OO, N, NN> CanonicalOrd<Tsig<OO, NN>> for Tsig<O, N>where
O: AsRef<[u8]>,
OO: AsRef<[u8]>,
N: ToDname,
NN: ToDname,
impl<O, OO, N, NN> CanonicalOrd<Tsig<OO, NN>> for Tsig<O, N>where O: AsRef<[u8]>, OO: AsRef<[u8]>, N: ToDname, NN: ToDname,
source§fn canonical_cmp(&self, other: &Tsig<OO, NN>) -> Ordering
fn canonical_cmp(&self, other: &Tsig<OO, NN>) -> Ordering
self
and other
.source§fn canonical_lt(&self, other: &Rhs) -> bool
fn canonical_lt(&self, other: &Rhs) -> bool
self
is canonically less than other
.source§fn canonical_le(&self, other: &Rhs) -> bool
fn canonical_le(&self, other: &Rhs) -> bool
self
is canonically less than or equal to other
.source§fn canonical_gt(&self, other: &Rhs) -> bool
fn canonical_gt(&self, other: &Rhs) -> bool
self
is canonically greater than other
.source§fn canonical_ge(&self, other: &Rhs) -> bool
fn canonical_ge(&self, other: &Rhs) -> bool
self
is canonically greater than or equal to other
.source§impl<O: AsRef<[u8]>, N: Compose> Compose for Tsig<O, N>
impl<O: AsRef<[u8]>, N: Compose> Compose for Tsig<O, N>
source§impl<O, N> From<Tsig<O, N>> for AllRecordData<O, N>
impl<O, N> From<Tsig<O, N>> for AllRecordData<O, N>
source§impl<Octets, SrcOctets, Name, SrcName> OctetsFrom<Tsig<SrcOctets, SrcName>> for Tsig<Octets, Name>where
Octets: OctetsFrom<SrcOctets>,
Name: OctetsFrom<SrcName>,
impl<Octets, SrcOctets, Name, SrcName> OctetsFrom<Tsig<SrcOctets, SrcName>> for Tsig<Octets, Name>where Octets: OctetsFrom<SrcOctets>, Name: OctetsFrom<SrcName>,
source§impl<O: AsRef<[u8]>, N: ToDname> Ord for Tsig<O, N>
impl<O: AsRef<[u8]>, N: ToDname> Ord for Tsig<O, N>
source§impl<O, OO, N, NN> PartialEq<Tsig<OO, NN>> for Tsig<O, N>where
O: AsRef<[u8]>,
OO: AsRef<[u8]>,
N: ToDname,
NN: ToDname,
impl<O, OO, N, NN> PartialEq<Tsig<OO, NN>> for Tsig<O, N>where O: AsRef<[u8]>, OO: AsRef<[u8]>, N: ToDname, NN: ToDname,
source§impl<O, OO, N, NN> PartialOrd<Tsig<OO, NN>> for Tsig<O, N>where
O: AsRef<[u8]>,
OO: AsRef<[u8]>,
N: ToDname,
NN: ToDname,
impl<O, OO, N, NN> PartialOrd<Tsig<OO, NN>> for Tsig<O, N>where O: AsRef<[u8]>, OO: AsRef<[u8]>, N: ToDname, NN: ToDname,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more