Struct bitcoin::util::privkey::Privkey [−][src]
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]
impl Privkey
pub fn from_secret_key(
key: SecretKey,
compressed: bool,
network: Network
) -> Privkey
[src]
pub fn from_secret_key(
key: SecretKey,
compressed: bool,
network: Network
) -> Privkey
Creates a Privkey
from a raw secp256k1 secret key
pub fn public_key<C: Signing>(&self, secp: &Secp256k1<C>) -> PublicKey
[src]
pub fn public_key<C: Signing>(&self, secp: &Secp256k1<C>) -> PublicKey
Computes the public key as supposed to be used with this secret
pub fn to_address<C: Signing>(&self, secp: &Secp256k1<C>) -> Address
[src]
pub fn to_address<C: Signing>(&self, secp: &Secp256k1<C>) -> Address
Converts a private key to a segwit address
pub fn to_legacy_address<C: Signing>(&self, secp: &Secp256k1<C>) -> Address
[src]
pub fn to_legacy_address<C: Signing>(&self, secp: &Secp256k1<C>) -> Address
Converts a private key to a legacy (non-segwit) address
pub fn secret_key(&self) -> &SecretKey
[src]
pub fn secret_key(&self) -> &SecretKey
Accessor for the underlying secp key
pub fn into_secret_key(self) -> SecretKey
[src]
pub fn into_secret_key(self) -> SecretKey
Accessor for the underlying secp key that consumes the privkey
pub fn network(&self) -> Network
[src]
pub fn network(&self) -> Network
Accessor for the network type
pub fn is_compressed(&self) -> bool
[src]
pub fn is_compressed(&self) -> bool
Accessor for the compressed flag
Trait Implementations
impl Clone for Privkey
[src]
impl Clone for Privkey
fn clone(&self) -> Privkey
[src]
fn clone(&self) -> Privkey
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for Privkey
[src]
impl PartialEq for Privkey
fn eq(&self, other: &Privkey) -> bool
[src]
fn eq(&self, other: &Privkey) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Privkey) -> bool
[src]
fn ne(&self, other: &Privkey) -> bool
This method tests for !=
.
impl Eq for Privkey
[src]
impl Eq for Privkey
impl Display for Privkey
[src]
impl Display for Privkey
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl FromStr for Privkey
[src]
impl FromStr for Privkey