pub struct SigningKey { /* private fields */ }Expand description
A ECDSA signing (private) key on the STARK curve.
Implementations§
Source§impl SigningKey
impl SigningKey
Sourcepub fn from_random() -> SigningKey
pub fn from_random() -> SigningKey
Generates a new key pair from a cryptographically secure RNG.
Sourcepub const fn from_secret_scalar(secret_scalar: Felt) -> SigningKey
pub const fn from_secret_scalar(secret_scalar: Felt) -> SigningKey
Constructs SigningKey directly from a secret scalar.
Sourcepub fn from_keystore<P>(
path: P,
password: &str,
) -> Result<SigningKey, KeystoreError>
pub fn from_keystore<P>( path: P, password: &str, ) -> Result<SigningKey, KeystoreError>
Loads the private key from a Web3 Secret Storage Definition keystore.
Sourcepub fn save_as_keystore<P>(
&self,
path: P,
password: &str,
) -> Result<(), KeystoreError>
pub fn save_as_keystore<P>( &self, path: P, password: &str, ) -> Result<(), KeystoreError>
Encrypts and saves the private key to a Web3 Secret Storage Definition JSON file.
Sourcepub const fn secret_scalar(&self) -> Felt
pub const fn secret_scalar(&self) -> Felt
Gets the secret scalar in the signing key.
Sourcepub fn verifying_key(&self) -> VerifyingKey
pub fn verifying_key(&self) -> VerifyingKey
Derives the verifying (public) key that corresponds to the signing key.
Trait Implementations§
Source§impl Clone for SigningKey
impl Clone for SigningKey
Source§fn clone(&self) -> SigningKey
fn clone(&self) -> SigningKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SigningKey
impl Debug for SigningKey
Source§impl From<SigningKey> for LocalWallet
impl From<SigningKey> for LocalWallet
Source§fn from(value: SigningKey) -> LocalWallet
fn from(value: SigningKey) -> LocalWallet
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SigningKey
impl RefUnwindSafe for SigningKey
impl Send for SigningKey
impl Sync for SigningKey
impl Unpin for SigningKey
impl UnwindSafe for SigningKey
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