pub trait SecretKey: Send + Sync {
type PublicKey: PublicKey;
// Required methods
fn new() -> Self;
fn to_bytes(&self) -> Vec<u8> ⓘ;
fn from_bytes(bytes: impl AsRef<[u8]>) -> Result<Self, KeyPairError>
where Self: Sized;
fn to_hex(&self) -> String;
fn from_hex(hex: &str) -> Result<Self, KeyPairError>
where Self: Sized;
fn pubkey(&self) -> Self::PublicKey;
}Required Associated Types§
Required Methods§
Sourcefn from_bytes(bytes: impl AsRef<[u8]>) -> Result<Self, KeyPairError>where
Self: Sized,
fn from_bytes(bytes: impl AsRef<[u8]>) -> Result<Self, KeyPairError>where
Self: Sized,
Creates a secret key from a byte slice.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.