pub struct KeyPair {
pub public: PublicKey,
/* private fields */
}Expand description
An Ed25519 key pair. The secret key is zeroized when this struct is dropped.
Fields§
§public: PublicKeyImplementations§
Source§impl KeyPair
impl KeyPair
Sourcepub fn from_secret_bytes(bytes: [u8; 32]) -> Result<Self>
pub fn from_secret_bytes(bytes: [u8; 32]) -> Result<Self>
Reconstruct a key pair from raw secret-key bytes.
§Errors
Returns ExoError::CryptoError if the bytes are not a valid Ed25519
secret key.
Sourcepub fn verify(&self, message: &[u8], signature: &Signature) -> bool
pub fn verify(&self, message: &[u8], signature: &Signature) -> bool
Verify an Ed25519 signature against this key pair’s public key.
For Hybrid signatures use verify_hybrid instead.
Sourcepub fn public_key(&self) -> &PublicKey
pub fn public_key(&self) -> &PublicKey
Return a reference to the public key.
Sourcepub fn secret_key(&self) -> &SecretKey
pub fn secret_key(&self) -> &SecretKey
Return a reference to the secret key.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyPair
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnsafeUnpin 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