Struct secp256k1::key::PublicKey [−][src]
#[repr(transparent)]pub struct PublicKey(_);
A Secp256k1 public key, used for verification of signatures
Implementations
impl PublicKey
[src]
impl PublicKey
[src]pub fn as_ptr(&self) -> *const PublicKey
[src]
Obtains a raw const pointer suitable for use with FFI functions
pub fn as_mut_ptr(&mut self) -> *mut PublicKey
[src]
Obtains a raw mutable pointer suitable for use with FFI functions
pub fn from_secret_key<C: Signing>(
secp: &Secp256k1<C>,
sk: &SecretKey
) -> PublicKey
[src]
secp: &Secp256k1<C>,
sk: &SecretKey
) -> PublicKey
Creates a new public key from a secret key.
pub fn from_slice(data: &[u8]) -> Result<PublicKey, Error>
[src]
Creates a public key directly from a slice
pub fn serialize(&self) -> [u8; 33]
[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 serialize_uncompressed(&self) -> [u8; 65]
[src]
Serialize the key as a byte-encoded pair of values, in uncompressed form
pub fn negate_assign<C: Verification>(&mut self, secp: &Secp256k1<C>)
[src]
Negates the pk to the pk self
in place
Will return an error if the pk would be invalid.
pub fn add_exp_assign<C: Verification>(
&mut self,
secp: &Secp256k1<C>,
other: &[u8]
) -> Result<(), Error>
[src]
&mut self,
secp: &Secp256k1<C>,
other: &[u8]
) -> Result<(), Error>
Adds the pk corresponding to other
to the pk self
in place
Will return an error if the resulting key would be invalid or
if the tweak was not a 32-byte length slice.
pub fn mul_assign<C: Verification>(
&mut self,
secp: &Secp256k1<C>,
other: &[u8]
) -> Result<(), Error>
[src]
&mut self,
secp: &Secp256k1<C>,
other: &[u8]
) -> Result<(), Error>
Muliplies the pk self
in place by the scalar other
Will return an error if the resulting key would be invalid or
if the tweak was not a 32-byte length slice.
pub fn combine(&self, other: &PublicKey) -> Result<PublicKey, Error>
[src]
Adds a second key to this one, returning the sum. Returns an error if the result would be the point at infinity, i.e. we are adding this point to its own negation
pub fn combine_keys(keys: &[&PublicKey]) -> Result<PublicKey, Error>
[src]
Adds the keys in the provided slice together, returning the sum. Returns an error if the result would be the point at infinity, i.e. we are adding a point to its own negation
Trait Implementations
impl<'de> Deserialize<'de> for PublicKey
[src]
impl<'de> Deserialize<'de> for PublicKey
[src]fn deserialize<D: Deserializer<'de>>(d: D) -> Result<PublicKey, D::Error>
[src]
impl PartialOrd<PublicKey> for PublicKey
[src]
impl PartialOrd<PublicKey> for PublicKey
[src]