Struct bitcoin::util::address::Privkey
[−]
[src]
pub struct Privkey { pub compressed: bool, pub network: Network, pub key: SecretKey, }
A Bitcoin ECDSA private key
Fields
compressed: bool
Whether this private key represents a compressed address
network: Network
The network on which this key should be used
key: SecretKey
The actual ECDSA key
Methods
impl Privkey
[src]
fn from_key(network: Network, sk: SecretKey, compressed: bool) -> Privkey
Creates an address from a public key
fn to_address(&self, secp: &Secp256k1) -> Result<Address, Error>
Converts a private key to an address
fn secret_key(&self) -> &SecretKey
Accessor for the underlying secp key
fn into_secret_key(self) -> SecretKey
Accessor for the underlying secp key that consumes the privkey
fn network(&self) -> Network
Accessor for the network type
fn is_compressed(&self) -> bool
Accessor for the compressed flag
Trait Implementations
impl Eq for Privkey
[src]
impl PartialEq for Privkey
[src]
fn eq(&self, __arg_0: &Privkey) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Privkey) -> bool
This method tests for !=
.
impl Clone for Privkey
[src]
fn clone(&self) -> Privkey
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl ToBase58 for Privkey
[src]
fn base58_layout(&self) -> Vec<u8>
The serialization to be converted into base58
fn to_base58(&self) -> String
Obtain a string with the base58 encoding of the object
fn to_base58check(&self) -> String
Obtain a string with the base58check encoding of the object (Tack the first 4 256-digits of the object's Bitcoin hash onto the end.) Read more
impl FromBase58 for Privkey
[src]
fn from_base58_layout(data: Vec<u8>) -> Result<Privkey, Error>
Constructs an object from the byte-encoding (base 256) representation of its base58 format Read more
fn from_base58(data: &str) -> Result<Self, Error>
Obtain an object from its base58 encoding
fn from_base58check(data: &str) -> Result<Self, Error>
Obtain an object from its base58check encoding