#[non_exhaustive]pub enum PublicKeyEnum<'k> {
Rsa(Rsa<'k>),
Ec(Ec),
Ed25519(Ed25519<'k>),
}
Available on crate feature
dnssec
only.Expand description
Variants of all know public keys
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Rsa(Rsa<'k>)
Available on crate features
dnssec-openssl
or dnssec-ring
only.RSA keypair, supported by OpenSSL
Ec(Ec)
Available on crate feature
dnssec-ring
only.Elliptic curve keypair
Ed25519(Ed25519<'k>)
Available on crate feature
dnssec-ring
only.Ed25519 public key for the Algorithm::ED25519
Implementations§
Source§impl<'k> PublicKeyEnum<'k>
impl<'k> PublicKeyEnum<'k>
Sourcepub fn from_public_bytes(
public_key: &'k [u8],
algorithm: Algorithm,
) -> Result<Self, ProtoError>
pub fn from_public_bytes( public_key: &'k [u8], algorithm: Algorithm, ) -> Result<Self, ProtoError>
Converts the bytes into a PulbicKey of the specified algorithm
Trait Implementations§
Source§impl<'k> PublicKey for PublicKeyEnum<'k>
impl<'k> PublicKey for PublicKeyEnum<'k>
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<'k> Freeze for PublicKeyEnum<'k>
impl<'k> RefUnwindSafe for PublicKeyEnum<'k>
impl<'k> Send for PublicKeyEnum<'k>
impl<'k> Sync for PublicKeyEnum<'k>
impl<'k> Unpin for PublicKeyEnum<'k>
impl<'k> UnwindSafe for PublicKeyEnum<'k>
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