pub enum SecretKey {
EcdsaSecp256k1(SigningKey<Secp256k1>),
EcdsaRecoverableSecp256k1(SigningKey<Secp256k1>),
EcdsaSecp256r1(SigningKey<NistP256>),
Ed25519(Keypair),
Sr25519(Keypair, Option<MiniSecretKey>),
}
Expand description
Secret key used for constructing signatures.
Variants§
EcdsaSecp256k1(SigningKey<Secp256k1>)
ECDSA with secp256k1.
EcdsaRecoverableSecp256k1(SigningKey<Secp256k1>)
ECDSA with secp256k1 in Ethereum compatible format.
EcdsaSecp256r1(SigningKey<NistP256>)
ECDSA with NIST P-256.
Ed25519(Keypair)
Ed25519.
Sr25519(Keypair, Option<MiniSecretKey>)
Schnorrkel used by substrate/polkadot.
Implementations§
Source§impl SecretKey
impl SecretKey
Sourcepub fn from_bytes(
algorithm: Algorithm,
bytes: &[u8],
) -> Result<SecretKey, Error>
pub fn from_bytes( algorithm: Algorithm, bytes: &[u8], ) -> Result<SecretKey, Error>
Creates a secret key from a byte sequence for a given signing algorithm.
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Returns the public key used for verifying signatures.
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