[][src]Struct domain::rdata::rfc2845::Tsig

pub struct Tsig<O, N> { /* fields omitted */ }

Methods

impl<O, N> Tsig<O, N>[src]

pub fn new(
    algorithm: N,
    time_signed: Time48,
    fudge: u16,
    mac: O,
    original_id: u16,
    error: TsigRcode,
    other: O
) -> Self
[src]

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.

pub fn algorithm(&self) -> &N[src]

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.

pub fn time_signed(&self) -> Time48[src]

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.

pub fn fudge(&self) -> u16[src]

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.

pub fn mac(&self) -> &O[src]

Returns a reference to the bytes value containing the MAC.

pub fn mac_slice(&self) -> &[u8] where
    O: AsRef<[u8]>, 
[src]

Returns an octet slice containing the MAC.

pub fn into_mac(self) -> O[src]

Converts the record data into the MAC.

pub fn original_id(&self) -> u16[src]

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.

pub fn error(&self) -> TsigRcode[src]

Returns the TSIG error.

pub fn other(&self) -> &O[src]

Returns a reference to the other bytes.

This field is only used for BADTIME errors to return the server time. Otherwise it is empty.

pub fn other_time(&self) -> Option<Time48> where
    O: AsRef<[u8]>, 
[src]

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.

pub fn is_valid_now(&self) -> bool[src]

Returns whether the record is valid right now.

The method checks whether the current system time is within fudge seconds of the time_signed.

Trait Implementations

impl<O, OO, N, NN> CanonicalOrd<Tsig<OO, NN>> for Tsig<O, N> where
    O: AsRef<[u8]>,
    OO: AsRef<[u8]>,
    N: ToDname,
    NN: ToDname
[src]

impl<O: Clone, N: Clone> Clone for Tsig<O, N>[src]

impl<O: AsRef<[u8]>, N: Compose> Compose for Tsig<O, N>[src]

impl<O: AsRef<[u8]>, N: Debug> Debug for Tsig<O, N>[src]

impl<O: AsRef<[u8]>, N: Display> Display for Tsig<O, N>[src]

impl<O: AsRef<[u8]>, N: ToDname> Eq for Tsig<O, N>[src]

impl<O, N> From<Tsig<O, N>> for AllRecordData<O, N>[src]

impl<O: AsRef<[u8]>, N: Hash> Hash for Tsig<O, N>[src]

impl<O: AsRef<[u8]>, N: ToDname> Ord for Tsig<O, N>[src]

impl<Ref: OctetsRef> Parse<Ref> for Tsig<Ref::Range, ParsedDname<Ref>>[src]

impl<O, OO, N, NN> PartialEq<Tsig<OO, NN>> for Tsig<O, N> where
    O: AsRef<[u8]>,
    OO: AsRef<[u8]>,
    N: ToDname,
    NN: ToDname
[src]

impl<O, OO, N, NN> PartialOrd<Tsig<OO, NN>> for Tsig<O, N> where
    O: AsRef<[u8]>,
    OO: AsRef<[u8]>,
    N: ToDname,
    NN: ToDname
[src]

impl<O, N> RtypeRecordData for Tsig<O, N>[src]

Auto Trait Implementations

impl<O, N> RefUnwindSafe for Tsig<O, N> where
    N: RefUnwindSafe,
    O: RefUnwindSafe

impl<O, N> Send for Tsig<O, N> where
    N: Send,
    O: Send

impl<O, N> Sync for Tsig<O, N> where
    N: Sync,
    O: Sync

impl<O, N> Unpin for Tsig<O, N> where
    N: Unpin,
    O: Unpin

impl<O, N> UnwindSafe for Tsig<O, N> where
    N: UnwindSafe,
    O: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<Octets, T> ParseRecordData<Octets> for T where
    T: RtypeRecordData + Parse<Octets> + Compose
[src]

impl<T> RecordData for T where
    T: Compose + RtypeRecordData
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,