[][src]Struct secp256k1zkp::key::PublicKey

pub struct PublicKey(pub PublicKey);

A Secp256k1 public key, used for verification of signatures

Implementations

impl PublicKey[src]

pub fn new() -> PublicKey[src]

Creates a new zeroed out public key

pub fn from_combination(
    secp: &Secp256k1,
    in_keys: Vec<&PublicKey>
) -> Result<PublicKey, Error>
[src]

Creates a new public key as the sum of the provided keys

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

Determines whether a pubkey is valid

pub fn as_ptr(&self) -> *const PublicKey[src]

Obtains a raw pointer suitable for use with FFI functions

pub fn as_mut_ptr(&mut self) -> *mut PublicKey[src]

Obtains a mutable raw pointer suitable for use with FFI functions

pub fn from_secp256k1_pubkey(pk: PublicKey) -> PublicKey[src]

Creates a new public key from a Secp256k1 public key

pub fn from_secret_key(
    secp: &Secp256k1,
    sk: &SecretKey
) -> Result<PublicKey, Error>
[src]

Creates a new public key from a secret key.

pub fn from_slice(secp: &Secp256k1, data: &[u8]) -> Result<PublicKey, Error>[src]

Creates a public key directly from a slice

pub fn serialize_vec(
    &self,
    secp: &Secp256k1,
    compressed: bool
) -> ArrayVec<[u8; 72]>
[src]

Serialize the key as a byte-encoded pair of values. In compressed form the y-coordinate is represented by only a single bit, as x determines it up to one bit.

pub fn add_exp_assign(
    &mut self,
    secp: &Secp256k1,
    other: &SecretKey
) -> Result<(), Error>
[src]

Adds the pk corresponding to other to the pk self in place

pub fn mul_assign(
    &mut self,
    secp: &Secp256k1,
    other: &SecretKey
) -> Result<(), Error>
[src]

Muliplies the pk self in place by the scalar other

Trait Implementations

impl Clone for PublicKey[src]

impl Copy for PublicKey[src]

impl Debug for PublicKey[src]

impl Decodable for PublicKey[src]

impl<'de> Deserialize<'de> for PublicKey[src]

impl Encodable for PublicKey[src]

impl Eq for PublicKey[src]

impl From<PublicKey> for PublicKey[src]

Creates a new public key from a FFI public key

impl Hash for PublicKey[src]

impl Ord for PublicKey[src]

impl PartialEq<PublicKey> for PublicKey[src]

impl PartialOrd<PublicKey> for PublicKey[src]

impl Serialize for PublicKey[src]

impl StructuralEq for PublicKey[src]

impl StructuralPartialEq for PublicKey[src]

Auto Trait Implementations

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<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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, 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.