Struct secp256k1zkp::key::PublicKey
source · pub struct PublicKey(pub PublicKey);
Expand description
A Secp256k1 public key, used for verification of signatures
Tuple Fields§
§0: PublicKey
Implementations§
source§impl PublicKey
impl PublicKey
sourcepub fn from_combination(
secp: &Secp256k1,
in_keys: Vec<&PublicKey>
) -> Result<PublicKey, Error>
pub fn from_combination( secp: &Secp256k1, in_keys: Vec<&PublicKey> ) -> Result<PublicKey, Error>
Creates a new public key as the sum of the provided keys
sourcepub fn as_ptr(&self) -> *const PublicKey
pub fn as_ptr(&self) -> *const PublicKey
Obtains a raw pointer suitable for use with FFI functions
sourcepub fn as_mut_ptr(&mut self) -> *mut PublicKey
pub fn as_mut_ptr(&mut self) -> *mut PublicKey
Obtains a mutable raw pointer suitable for use with FFI functions
sourcepub fn from_secp256k1_pubkey(pk: PublicKey) -> PublicKey
pub fn from_secp256k1_pubkey(pk: PublicKey) -> PublicKey
Creates a new public key from a Secp256k1 public key
sourcepub fn from_secret_key(
secp: &Secp256k1,
sk: &SecretKey
) -> Result<PublicKey, Error>
pub fn from_secret_key( secp: &Secp256k1, sk: &SecretKey ) -> Result<PublicKey, Error>
Creates a new public key from a secret key.
sourcepub fn from_slice(secp: &Secp256k1, data: &[u8]) -> Result<PublicKey, Error>
pub fn from_slice(secp: &Secp256k1, data: &[u8]) -> Result<PublicKey, Error>
Creates a public key directly from a slice
sourcepub fn serialize_vec(
&self,
secp: &Secp256k1,
compressed: bool
) -> ArrayVec<[u8; 72]>
pub fn serialize_vec( &self, secp: &Secp256k1, compressed: bool ) -> ArrayVec<[u8; 72]>
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.
Trait Implementations§
source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
source§fn deserialize<D>(d: D) -> Result<PublicKey, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<PublicKey, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for PublicKey
impl Ord for PublicKey
source§impl PartialEq for PublicKey
impl PartialEq for PublicKey
source§impl PartialOrd for PublicKey
impl PartialOrd for PublicKey
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for PublicKey
impl Eq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more