[][src]Struct komodo_rpc_client::Privkey

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

Implementations

impl Privkey[src]

pub fn from_secret_key(
    key: SecretKey,
    compressed: bool,
    network: Network
) -> Privkey
[src]

Creates a Privkey from a raw secp256k1 secret key

pub fn public_key<C>(&self, secp: &Secp256k1<C>) -> PublicKey where
    C: Signing, 
[src]

Computes the public key as supposed to be used with this secret

pub fn to_address<C>(&self, secp: &Secp256k1<C>) -> Address where
    C: Signing, 
[src]

Converts a private key to a segwit address

pub fn to_legacy_address<C>(&self, secp: &Secp256k1<C>) -> Address where
    C: Signing, 
[src]

Converts a private key to a legacy (non-segwit) address

pub fn secret_key(&self) -> &SecretKey[src]

Accessor for the underlying secp key

pub fn into_secret_key(self) -> SecretKey[src]

Accessor for the underlying secp key that consumes the privkey

pub fn network(&self) -> Network[src]

Accessor for the network type

pub fn is_compressed(&self) -> bool[src]

Accessor for the compressed flag

Trait Implementations

impl Clone for Privkey[src]

impl Display for Privkey[src]

impl Eq for Privkey[src]

impl FromStr for Privkey[src]

type Err = Error

The associated error which can be returned from parsing.

impl PartialEq<Privkey> for Privkey[src]

impl StructuralEq for Privkey[src]

impl StructuralPartialEq for Privkey[src]

Auto Trait Implementations

impl RefUnwindSafe for Privkey

impl Send for Privkey

impl Sync for Privkey

impl Unpin for Privkey

impl UnwindSafe for Privkey

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.