pub struct VerifyingKey { /* private fields */ }Expand description
ECDSA/secp256k1 verification key (i.e. public key)
§serde support
When the serde feature of this crate is enabled, the Serialize and
Deserialize traits are impl’d for this type.
The serialization is binary-oriented and supports ASN.1 DER-encoded X.509 Subject Public Key Info (SPKI) as the encoding format.
For a more text-friendly encoding of public keys, use
[elliptic_curve::JwkEcKey] instead.
Implementations§
Source§impl VerifyingKey
impl VerifyingKey
Sourcepub fn from_sec1_bytes(bytes: &[u8]) -> Result<VerifyingKey, Error>
pub fn from_sec1_bytes(bytes: &[u8]) -> Result<VerifyingKey, Error>
Initialize VerifyingKey from a SEC1-encoded public key.
Sourcepub fn from_encoded_point(
public_key: &EncodedPoint<<<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>,
) -> Result<VerifyingKey, Error>
pub fn from_encoded_point( public_key: &EncodedPoint<<<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>, ) -> Result<VerifyingKey, Error>
Initialize VerifyingKey from a SEC1 EncodedPoint.
Trait Implementations§
Source§impl Clone for VerifyingKey
impl Clone for VerifyingKey
Source§fn clone(&self) -> VerifyingKey
fn clone(&self) -> VerifyingKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VerifyingKey
impl Debug for VerifyingKey
Source§impl DecodePublicKey for VerifyingKey
impl DecodePublicKey for VerifyingKey
Source§fn from_public_key_der(bytes: &[u8]) -> Result<Self, Error>
fn from_public_key_der(bytes: &[u8]) -> Result<Self, Error>
Deserialize object from ASN.1 DER-encoded
SubjectPublicKeyInfo
(binary format).Source§impl<D> DigestVerifier<D, Signature<Secp256k1>> for VerifyingKey
impl<D> DigestVerifier<D, Signature<Secp256k1>> for VerifyingKey
Source§impl<D> DigestVerifier<D, Signature> for VerifyingKey
impl<D> DigestVerifier<D, Signature> for VerifyingKey
Source§impl From<&SigningKey> for VerifyingKey
impl From<&SigningKey> for VerifyingKey
Source§fn from(signing_key: &SigningKey) -> VerifyingKey
fn from(signing_key: &SigningKey) -> VerifyingKey
Converts to this type from the input type.
Source§impl From<SigningKey> for VerifyingKey
impl From<SigningKey> for VerifyingKey
Source§fn from(signing_key: SigningKey) -> VerifyingKey
fn from(signing_key: SigningKey) -> VerifyingKey
Converts to this type from the input type.
Source§impl From<VerifyingKey<Secp256k1>> for VerifyingKey
impl From<VerifyingKey<Secp256k1>> for VerifyingKey
Source§fn from(verifying_key: VerifyingKey<Secp256k1>) -> VerifyingKey
fn from(verifying_key: VerifyingKey<Secp256k1>) -> VerifyingKey
Converts to this type from the input type.
Source§impl Ord for VerifyingKey
impl Ord for VerifyingKey
Source§fn cmp(&self, other: &VerifyingKey) -> Ordering
fn cmp(&self, other: &VerifyingKey) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for VerifyingKey
impl PartialEq for VerifyingKey
Source§impl PartialOrd for VerifyingKey
impl PartialOrd for VerifyingKey
Source§impl PrehashVerifier<Signature<Secp256k1>> for VerifyingKey
impl PrehashVerifier<Signature<Secp256k1>> for VerifyingKey
Source§impl PrehashVerifier<Signature> for VerifyingKey
impl PrehashVerifier<Signature> for VerifyingKey
Source§impl ToEncodedPoint<Secp256k1> for VerifyingKey
impl ToEncodedPoint<Secp256k1> for VerifyingKey
Source§fn to_encoded_point(
&self,
compress: bool,
) -> EncodedPoint<<<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>
fn to_encoded_point( &self, compress: bool, ) -> EncodedPoint<<<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>
Serialize this value as a SEC1
EncodedPoint, optionally applying
point compression.Source§impl TryFrom<&AffinePoint> for VerifyingKey
impl TryFrom<&AffinePoint> for VerifyingKey
Source§impl TryFrom<&EncodedPoint<<<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>> for VerifyingKey
impl TryFrom<&EncodedPoint<<<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>> for VerifyingKey
Source§impl TryFrom<&ProjectivePoint> for VerifyingKey
impl TryFrom<&ProjectivePoint> for VerifyingKey
Source§impl TryFrom<AffinePoint> for VerifyingKey
impl TryFrom<AffinePoint> for VerifyingKey
Source§impl TryFrom<ProjectivePoint> for VerifyingKey
impl TryFrom<ProjectivePoint> for VerifyingKey
Source§impl TryFrom<SubjectPublicKeyInfo<'_>> for VerifyingKey
impl TryFrom<SubjectPublicKeyInfo<'_>> for VerifyingKey
Source§impl<S> Verifier<S> for VerifyingKey
impl<S> Verifier<S> for VerifyingKey
impl Copy for VerifyingKey
impl Eq for VerifyingKey
impl StructuralPartialEq for VerifyingKey
Auto Trait Implementations§
impl Freeze for VerifyingKey
impl RefUnwindSafe for VerifyingKey
impl Send for VerifyingKey
impl Sync for VerifyingKey
impl Unpin for VerifyingKey
impl UnwindSafe for VerifyingKey
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