pub struct Ed25519<'k> { /* private fields */ }
Available on crate features
dnssec
and dnssec-ring
only.Expand description
Ed25519 Public key
Implementations§
Source§impl<'k> Ed25519<'k>
impl<'k> Ed25519<'k>
Sourcepub fn from_public_bytes(public_key: &'k [u8]) -> Result<Self, ProtoError>
pub fn from_public_bytes(public_key: &'k [u8]) -> Result<Self, ProtoError>
Internet-Draft EdDSA for DNSSEC December 2016
An Ed25519 public key consists of a 32-octet value, which is encoded
into the Public Key field of a DNSKEY resource record as a simple bit
string. The generation of a public key is defined in Section 5.1.5
in [RFC 8032]. Breaking tradition, the keys are encoded in little-
endian byte order.
Trait Implementations§
Source§impl<'k> PublicKey for Ed25519<'k>
impl<'k> PublicKey for Ed25519<'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,
message: &[u8],
signature: &[u8],
) -> Result<(), ProtoError>
fn verify( &self, _: 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 Ed25519<'k>
impl<'k> RefUnwindSafe for Ed25519<'k>
impl<'k> Send for Ed25519<'k>
impl<'k> Sync for Ed25519<'k>
impl<'k> Unpin for Ed25519<'k>
impl<'k> UnwindSafe for Ed25519<'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