Struct ipfs_embed::identity::secp256k1::SecretKey
pub struct SecretKey(_);
Expand description
A Secp256k1 secret key.
Implementations§
§impl SecretKey
impl SecretKey
pub fn from_bytes(sk: impl AsMut<[u8]>) -> Result<SecretKey, DecodingError>
pub fn from_bytes(sk: impl AsMut<[u8]>) -> Result<SecretKey, DecodingError>
Create a secret key from a byte slice, zeroing the slice on success. If the bytes do not constitute a valid Secp256k1 secret key, an error is returned.
Note that the expected binary format is the same as libsecp256k1
’s.
pub fn from_der(der: impl AsMut<[u8]>) -> Result<SecretKey, DecodingError>
pub fn from_der(der: impl AsMut<[u8]>) -> Result<SecretKey, DecodingError>
Decode a DER-encoded Secp256k1 secret key in an ECPrivateKey structure as defined in RFC5915, zeroing the input slice on success.