pub trait PublicKey {
// Required methods
fn public_bytes(&self) -> &[u8] ⓘ;
fn verify(&self, message: &[u8], signature: &[u8]) -> Result<(), ProtoError>;
fn algorithm(&self) -> Algorithm;
}
Available on crate feature
dnssec
only.Expand description
PublicKeys implement the ability to ideally be zero copy abstractions over public keys for verifying signed content.
In DNS the KEY and DNSKEY types are generally the RData types which store public key material.
Required Methods§
Sourcefn public_bytes(&self) -> &[u8] ⓘ
fn public_bytes(&self) -> &[u8] ⓘ
Returns the public bytes of the public key, in DNS format
Sourcefn verify(&self, message: &[u8], signature: &[u8]) -> Result<(), ProtoError>
fn verify(&self, message: &[u8], signature: &[u8]) -> Result<(), ProtoError>
Verifies the hash matches the signature with the current key
.
§Arguments
message
- the message to be validated, seehash_rrset
signature
- the signature to use to verify the hash, extracted from anRData::RRSIG
for example.
§Return value
True if and only if the signature is valid for the hash. This will always return
false if the key
.
Implementors§
impl PublicKey for hickory_proto::dnssec::openssl::Ec<'_>
Available on crate feature
dnssec-openssl
only.impl PublicKey for hickory_proto::dnssec::openssl::Rsa<'_>
Available on crate feature
dnssec-openssl
only.impl PublicKey for Ed25519<'_>
Available on crate feature
dnssec-ring
only.impl PublicKey for hickory_proto::dnssec::ring::Rsa<'_>
Available on crate feature
dnssec-ring
only.impl PublicKey for PublicKeyBuf
impl PublicKey for hickory_proto::dnssec::ring::Ec
Available on crate feature
dnssec-ring
only.