[][src]Trait trust_dns_client::rr::dnssec::Verifier

pub trait Verifier {
    fn algorithm(&self) -> Algorithm;
fn key(&'k self) -> Result<PublicKeyEnum<'k>, ProtoError>; fn verify(&self, hash: &[u8], signature: &[u8]) -> Result<(), ProtoError> { ... }
fn verify_message<M>(
        &self,
        message: &M,
        signature: &[u8],
        sig0: &SIG
    ) -> Result<(), ProtoError>
    where
        M: BinEncodable
, { ... }
fn verify_rrsig(
        &self,
        name: &Name,
        dns_class: DNSClass,
        sig: &SIG,
        records: &[Record]
    ) -> Result<(), ProtoError> { ... } }

Types which are able to verify DNS based signatures

Required methods

fn algorithm(&self) -> Algorithm

Return the algorithm which this Verifier covers

fn key(&'k self) -> Result<PublicKeyEnum<'k>, ProtoError>

Return the public key associated with this verifier

Loading content...

Provided methods

fn verify(&self, hash: &[u8], signature: &[u8]) -> Result<(), ProtoError>

Verifies the hash matches the signature with the current key.

Arguments

  • hash - the hash to be validated, see rrset_tbs
  • signature - the signature to use to verify the hash, extracted from an RData::RRSIG for example.

Return value

True if and only if the signature is valid for the hash. false if the key.

fn verify_message<M>(
    &self,
    message: &M,
    signature: &[u8],
    sig0: &SIG
) -> Result<(), ProtoError> where
    M: BinEncodable

Verifies a message with the against the given signature, i.e. SIG0

Arguments

  • message - the message to verify
  • signature - the signature to use for validation

Return value

true if the message could be validated against the signature, false otherwise

fn verify_rrsig(
    &self,
    name: &Name,
    dns_class: DNSClass,
    sig: &SIG,
    records: &[Record]
) -> Result<(), ProtoError>

Verifies an RRSig with the associated key, e.g. DNSKEY

Arguments

  • name - name associated with the rrsig being validated
  • dns_class - DNSClass of the records, generally IN
  • sig - signature record being validated
  • records - Records covered by SIG
Loading content...

Implementors

impl Verifier for DNSKEY[src]

impl Verifier for KEY[src]

Loading content...