pub struct PublicKey(_);
Expand description
A Secp256k1 public key, used for verification of signatures
Implementations§
source§impl PublicKey
impl PublicKey
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 from_secret_key<C: Signing>(
secp: &Secp256k1<C>,
sk: &SecretKey
) -> PublicKey
pub fn from_secret_key<C: Signing>(
secp: &Secp256k1<C>,
sk: &SecretKey
) -> PublicKey
Creates a new public key from a secret key.
sourcepub fn from_slice<C>(
secp: &Secp256k1<C>,
data: &[u8]
) -> Result<PublicKey, Error>
pub fn from_slice<C>(
secp: &Secp256k1<C>,
data: &[u8]
) -> Result<PublicKey, Error>
Creates a public key directly from a slice
sourcepub fn serialize(&self) -> [u8; 33]
pub fn serialize(&self) -> [u8; 33]
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.
sourcepub fn serialize_uncompressed(&self) -> [u8; 65]
pub fn serialize_uncompressed(&self) -> [u8; 65]
Serialize the key as a byte-encoded pair of values, in uncompressed form
sourcepub fn add_exp_assign<C: Verification>(
&mut self,
secp: &Secp256k1<C>,
other: &SecretKey
) -> Result<(), Error>
pub fn add_exp_assign<C: Verification>(
&mut self,
secp: &Secp256k1<C>,
other: &SecretKey
) -> Result<(), Error>
Adds the pk corresponding to other
to the pk self
in place
sourcepub fn mul_assign<C: Verification>(
&mut self,
secp: &Secp256k1<C>,
other: &SecretKey
) -> Result<(), Error>
pub fn mul_assign<C: Verification>(
&mut self,
secp: &Secp256k1<C>,
other: &SecretKey
) -> Result<(), Error>
Muliplies the pk self
in place by the scalar other
Trait Implementations§
source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<PublicKey, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<PublicKey, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for PublicKey
impl Ord for PublicKey
source§impl PartialOrd<PublicKey> for PublicKey
impl PartialOrd<PublicKey> 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 more