Struct libp2p_identity::ed25519::SecretKey
source · pub struct SecretKey(_);
Available on crate feature
ed25519
only.Expand description
An Ed25519 secret key.
Implementations§
source§impl SecretKey
impl SecretKey
sourcepub fn from_bytes(
sk_bytes: impl AsMut<[u8]>
) -> Result<SecretKey, DecodingError>
👎Deprecated since 0.2.0: This method name does not follow Rust naming conventions, use SecretKey::try_from_bytes
instead.
pub fn from_bytes( sk_bytes: impl AsMut<[u8]> ) -> Result<SecretKey, DecodingError>
SecretKey::try_from_bytes
instead.Create an Ed25519 secret key from a byte slice, zeroing the input on success. If the bytes do not constitute a valid Ed25519 secret key, an error is returned.
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 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