Struct libp2p_core::identity::secp256k1::PublicKey
source · pub struct PublicKey(_);
Available on crate feature
secp256k1
only.Expand description
A Secp256k1 public key.
Implementations§
source§impl 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§
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