pub struct Keypair(/* private fields */);Expand description
Ed25519 keypair to sign dns Packets.
Implementations§
Source§impl Keypair
impl Keypair
Sourcepub fn from_secret_key(secret_key: &[u8; 32]) -> Keypair
pub fn from_secret_key(secret_key: &[u8; 32]) -> Keypair
Creates a Keypair from a given SecretKey.
Sourcepub fn sign(&self, message: &[u8]) -> Signature
pub fn sign(&self, message: &[u8]) -> Signature
Signs a message with the private key of this Keypair.
Sourcepub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>
pub fn verify(&self, message: &[u8], signature: &Signature) -> Result<(), Error>
Verifies a message against a given signature using this Keypair.
Sourcepub fn secret_key(&self) -> [u8; 32]
pub fn secret_key(&self) -> [u8; 32]
Returns the secret part of this Keypair.
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Returns the PublicKey of this Keypair.
Sourcepub fn to_z32(&self) -> String
pub fn to_z32(&self) -> String
Converts the public key of this Keypair to a z-base32 encoded string.
Sourcepub fn to_uri_string(&self) -> String
pub fn to_uri_string(&self) -> String
Converts the public key of this Keypair to a URI string.
Trait Implementations§
impl Eq for Keypair
impl StructuralPartialEq for Keypair
Auto Trait Implementations§
impl Freeze for Keypair
impl RefUnwindSafe for Keypair
impl Send for Keypair
impl Sync for Keypair
impl Unpin for Keypair
impl UnwindSafe for Keypair
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