pub struct PublicKey(_);
Expand description
An ECDSA 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 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
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 · sourcefn borrow_mut(&mut self) -> &mut T
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.
sourcefn clone_into(&self, target: &mut T)
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