pub trait Verifier {
// Required methods
fn algorithm(&self) -> Algorithm;
fn key(&self) -> Result<Arc<dyn PublicKey + '_>, ProtoError>;
// Provided methods
fn verify(&self, hash: &[u8], signature: &[u8]) -> Result<(), ProtoError> { ... }
fn verify_message<M: BinEncodable>(
&self,
message: &M,
signature: &[u8],
sig0: &SIG,
) -> Result<(), ProtoError> { ... }
fn verify_rrsig<'a>(
&self,
name: &Name,
dns_class: DNSClass,
sig: &RRSIG,
records: impl Iterator<Item = &'a Record>,
) -> Result<(), ProtoError> { ... }
}Expand description
Types which are able to verify DNS based signatures
Required Methods§
Provided Methods§
Sourcefn verify(&self, hash: &[u8], signature: &[u8]) -> Result<(), ProtoError>
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, seerrset_tbssignature- the signature to use to verify the hash, extracted from anRData::RRSIGfor example.
§Return value
True if and only if the signature is valid for the hash.
false if the key.
Sourcefn verify_message<M: BinEncodable>(
&self,
message: &M,
signature: &[u8],
sig0: &SIG,
) -> Result<(), ProtoError>
fn verify_message<M: BinEncodable>( &self, message: &M, signature: &[u8], sig0: &SIG, ) -> Result<(), ProtoError>
Sourcefn verify_rrsig<'a>(
&self,
name: &Name,
dns_class: DNSClass,
sig: &RRSIG,
records: impl Iterator<Item = &'a Record>,
) -> Result<(), ProtoError>
fn verify_rrsig<'a>( &self, name: &Name, dns_class: DNSClass, sig: &RRSIG, records: impl Iterator<Item = &'a Record>, ) -> Result<(), ProtoError>
Verifies an RRSig with the associated key, e.g. DNSKEY
§Arguments
name- name associated with the rrsig being validateddns_class- DNSClass of the records, generally INsig- signature record being validatedrecords- Records covered by SIG
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.