pub struct PublicKey(_);
Expand description
A Secp256k1 public key.
Implementations
sourceimpl PublicKey
impl PublicKey
sourcepub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool
pub fn verify(&self, msg: &[u8], sig: &[u8]) -> bool
Verify the Secp256k1 signature on a message using the public key.
sourcepub fn verify_hash(&self, msg: &[u8], sig: &[u8]) -> bool
pub fn verify_hash(&self, msg: &[u8], sig: &[u8]) -> bool
Verify the Secp256k1 DER-encoded signature on a raw 256-bit message using the public key.
sourcepub fn encode(&self) -> [u8; 33]
pub fn encode(&self) -> [u8; 33]
Encode the public key in compressed form, i.e. with one coordinate represented by a single bit.
sourcepub fn encode_uncompressed(&self) -> [u8; 65]
pub fn encode_uncompressed(&self) -> [u8; 65]
Encode the public key in uncompressed form.
Trait Implementations
impl Eq for PublicKey
impl StructuralEq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more