pub struct Pubkey { /* private fields */ }
Expand description
A Secp256k1 512-bit public key, used for verification of signatures
Implementations§
Source§impl Pubkey
impl Pubkey
Sourcepub fn verify(
&self,
message: &Message,
signature: &Signature,
) -> Result<(), Error>
pub fn verify( &self, message: &Message, signature: &Signature, ) -> Result<(), Error>
Checks that signature
is a valid ECDSA signature for message
using the public
key pubkey
Sourcepub fn serialize(&self) -> Vec<u8>
pub fn serialize(&self) -> Vec<u8>
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 from_slice(data: &[u8]) -> Result<Self, Error>
pub fn from_slice(data: &[u8]) -> Result<Self, Error>
Creates a new Pubkey from a slice
Trait Implementations§
impl Eq for Pubkey
impl StructuralPartialEq for Pubkey
Auto Trait Implementations§
impl Freeze for Pubkey
impl RefUnwindSafe for Pubkey
impl Send for Pubkey
impl Sync for Pubkey
impl Unpin for Pubkey
impl UnwindSafe for Pubkey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)