pub struct PublicKeyBuf { /* private fields */ }
Available on crate feature
dnssec
only.Expand description
An owned variant of PublicKey
Implementations§
Source§impl PublicKeyBuf
impl PublicKeyBuf
Sourcepub fn new(key_buf: Vec<u8>) -> Self
pub fn new(key_buf: Vec<u8>) -> Self
Constructs a new PublicKey from the specified bytes, these should be in DNSKEY form.
Sourcepub fn from_rsa<T: HasPublic>(key: &OpenSslRsa<T>) -> Self
Available on crate feature dnssec-openssl
only.
pub fn from_rsa<T: HasPublic>(key: &OpenSslRsa<T>) -> Self
dnssec-openssl
only.Constructs a new PublicKeyBuf
from an OpenSslRsa
key.
Sourcepub fn from_ec<T: HasPublic>(ec_key: &EcKey<T>) -> DnsSecResult<Self>
Available on crate feature dnssec-openssl
only.
pub fn from_ec<T: HasPublic>(ec_key: &EcKey<T>) -> DnsSecResult<Self>
dnssec-openssl
only.Constructs a new PublicKeyBuf
from an openssl EcKey
.
Sourcepub fn into_inner(self) -> Vec<u8>
pub fn into_inner(self) -> Vec<u8>
Extract the inner buffer of public key bytes.
Trait Implementations§
Source§impl PublicKey for PublicKeyBuf
impl PublicKey for PublicKeyBuf
Source§fn public_bytes(&self) -> &[u8] ⓘ
fn public_bytes(&self) -> &[u8] ⓘ
Returns the public bytes of the public key, in DNS format
Source§fn verify(
&self,
algorithm: Algorithm,
message: &[u8],
signature: &[u8],
) -> Result<(), ProtoError>
fn verify( &self, algorithm: Algorithm, message: &[u8], signature: &[u8], ) -> Result<(), ProtoError>
Verifies the hash matches the signature with the current
key
. Read moreSource§fn to_sig0key(&self, algorithm: Algorithm) -> KEY
fn to_sig0key(&self, algorithm: Algorithm) -> KEY
Convert this keypair into a KEY record type for usage with SIG0
with key type entity (
KeyUsage::Entity
). Read moreSource§fn to_sig0key_with_usage(&self, algorithm: Algorithm, usage: KeyUsage) -> KEY
fn to_sig0key_with_usage(&self, algorithm: Algorithm, usage: KeyUsage) -> KEY
Convert this keypair into a KEY record type for usage with SIG0
with a given key (usage) type. Read more
Source§fn to_ds(
&self,
name: &Name,
algorithm: Algorithm,
digest_type: DigestType,
) -> DnsSecResult<DS>
fn to_ds( &self, name: &Name, algorithm: Algorithm, digest_type: DigestType, ) -> DnsSecResult<DS>
Creates a DS record for this KeyPair associated to the given name Read more
Auto Trait Implementations§
impl Freeze for PublicKeyBuf
impl RefUnwindSafe for PublicKeyBuf
impl Send for PublicKeyBuf
impl Sync for PublicKeyBuf
impl Unpin for PublicKeyBuf
impl UnwindSafe for PublicKeyBuf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more