mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-27 08:41:36 +00:00
Add secp256k1::SecretKey::to_bytes (#1126)
This commit is contained in:
@ -126,6 +126,11 @@ impl SecretKey {
|
|||||||
.map(|s| s.0.serialize_der().as_ref().into())
|
.map(|s| s.0.serialize_der().as_ref().into())
|
||||||
.map_err(|_| SigningError::new("failed to create secp256k1 signature"))
|
.map_err(|_| SigningError::new("failed to create secp256k1 signature"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the raw bytes of the secret key.
|
||||||
|
pub fn to_bytes(&self) -> [u8; 32] {
|
||||||
|
self.0.serialize()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A Secp256k1 public key.
|
/// A Secp256k1 public key.
|
||||||
|
Reference in New Issue
Block a user