Struct libp2p_core::identity::ecdsa::PublicKey
source · pub struct PublicKey(_);
Available on crate feature
ecdsa
only.Expand description
An ECDSA 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 an ECDSA signature on a message using the public key.
sourcepub fn from_bytes(k: &[u8]) -> Result<PublicKey, DecodingError>
pub fn from_bytes(k: &[u8]) -> Result<PublicKey, DecodingError>
Decode a public key from a byte buffer without compression.
sourcepub fn encode_der(&self) -> Vec<u8>
pub fn encode_der(&self) -> Vec<u8>
Encode a public key into a DER encoded byte buffer as defined by SEC1 standard.
sourcepub fn decode_der(k: &[u8]) -> Result<PublicKey, DecodingError>
pub fn decode_der(k: &[u8]) -> Result<PublicKey, DecodingError>
Decode a public key into a DER encoded byte buffer as defined by SEC1 standard.
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