pub struct PrivateKey(/* private fields */);Expand description
An Ed25519 private key.
Implementations§
Source§impl PrivateKey
impl PrivateKey
Sourcepub fn to_seed(&self) -> [u8; 32]
pub fn to_seed(&self) -> [u8; 32]
Returns the “seed” of this private key, as defined in RFC 8032.
Sourcepub fn from_seed(seed: &[u8; 32]) -> Self
pub fn from_seed(seed: &[u8; 32]) -> Self
Derives a key-pair from seed, which is the 32-byte private key representation defined
in RFC 8032.
Sourcepub fn sign_prehashed(
&self,
context: &[u8],
sha512_digest: &[u8; 64],
) -> Option<Signature>
pub fn sign_prehashed( &self, context: &[u8], sha512_digest: &[u8; 64], ) -> Option<Signature>
Signs the given sha512_digest with the given context using Ed25519ph.
Note that Ed25519ph (pre-hashed) and “pure” Ed25519 are different algorithms
defined in RFC 8032. Calling sign with the digest of a message will not
return the same output as sign_prehashed.
This function returns None if context is longer than 255 bytes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrivateKey
impl RefUnwindSafe for PrivateKey
impl Send for PrivateKey
impl Sync for PrivateKey
impl Unpin for PrivateKey
impl UnsafeUnpin for PrivateKey
impl UnwindSafe for PrivateKey
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