pub struct SecretKey(/* private fields */);
Available on crate feature
ed25519
only.Expand description
An Ed25519 secret key.
Implementations§
Source§impl SecretKey
impl SecretKey
Sourcepub fn generate() -> SecretKey
Available on crate feature rand
only.
pub fn generate() -> SecretKey
rand
only.Generate a new Ed25519 secret key.
Sourcepub fn try_from_bytes(
sk_bytes: impl AsMut<[u8]>,
) -> Result<SecretKey, DecodingError>
pub fn try_from_bytes( sk_bytes: impl AsMut<[u8]>, ) -> Result<SecretKey, DecodingError>
Try to parse an Ed25519 secret key from a byte slice containing the actual key, zeroing the input on success. If the bytes do not constitute a valid Ed25519 secret key, an error is returned.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SecretKey
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
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