Struct bitcoin::util::ecdsa::PrivateKey [−][src]
A Bitcoin ECDSA private key
Fields
compressed: bool
Whether this private key should be serialized as compressed
network: Network
The network on which this key should be used
key: SecretKey
The actual ECDSA key
Implementations
impl PrivateKey
[src]
impl PrivateKey
[src]pub fn new(key: SecretKey, network: Network) -> PrivateKey
[src]
Constructs compressed ECDSA private key from the provided generic Secp256k1 private key and the specified network
pub fn new_uncompressed(key: SecretKey, network: Network) -> PrivateKey
[src]
Constructs uncompressed (legacy) ECDSA private key from the provided generic Secp256k1 private key and the specified network
pub fn public_key<C: Signing>(&self, secp: &Secp256k1<C>) -> PublicKey
[src]
Creates a public key from this private key
pub fn to_bytes(&self) -> Vec<u8>
[src]
Serialize the private key to bytes
pub fn from_slice(data: &[u8], network: Network) -> Result<PrivateKey, Error>
[src]
Deserialize a private key from a slice
pub fn fmt_wif(&self, fmt: &mut dyn Write) -> Result
[src]
Format the private key to WIF format.
pub fn to_wif(&self) -> String
[src]
Get WIF encoding of this private key.
pub fn from_wif(wif: &str) -> Result<PrivateKey, Error>
[src]
Parse WIF encoded private key.
Trait Implementations
impl Clone for PrivateKey
[src]
impl Clone for PrivateKey
[src]fn clone(&self) -> PrivateKey
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'de> Deserialize<'de> for PrivateKey
[src]
impl<'de> Deserialize<'de> for PrivateKey
[src]fn deserialize<D: Deserializer<'de>>(d: D) -> Result<PrivateKey, D::Error>
[src]
impl FromStr for PrivateKey
[src]
impl FromStr for PrivateKey
[src]impl Index<RangeFull> for PrivateKey
[src]
impl Index<RangeFull> for PrivateKey
[src]impl PartialEq<PrivateKey> for PrivateKey
[src]
impl PartialEq<PrivateKey> for PrivateKey
[src]fn eq(&self, other: &PrivateKey) -> bool
[src]
fn ne(&self, other: &PrivateKey) -> bool
[src]
impl Serialize for PrivateKey
[src]
impl Serialize for PrivateKey
[src]