Struct k256::ecdsa::VerifyingKey
source · 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<Self, Error>
pub fn from_sec1_bytes(bytes: &[u8]) -> Result<Self, Error>
Initialize VerifyingKey
from a SEC1-encoded public key.
sourcepub fn from_encoded_point(public_key: &EncodedPoint) -> Result<Self, Error>
pub fn from_encoded_point(public_key: &EncodedPoint) -> Result<Self, Error>
Initialize VerifyingKey
from a SEC1 EncodedPoint
.
sourcepub fn to_bytes(&self) -> CompressedPoint
pub fn to_bytes(&self) -> CompressedPoint
Serialize this VerifyingKey
as a SEC1-encoded bytestring
(with point compression applied)
Trait Implementations§
source§impl AsRef<VerifyingKey> for SigningKey
impl AsRef<VerifyingKey> for SigningKey
source§fn as_ref(&self) -> &VerifyingKey
fn as_ref(&self) -> &VerifyingKey
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for VerifyingKey
impl Clone for VerifyingKey
source§fn clone(&self) -> VerifyingKey
fn clone(&self) -> VerifyingKey
Returns a copy 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<D> DigestVerifier<D, Signature<Secp256k1>> for VerifyingKeywhere
D: Digest + FixedOutput<OutputSize = U32>,
impl<D> DigestVerifier<D, Signature<Secp256k1>> for VerifyingKeywhere D: Digest + FixedOutput<OutputSize = U32>,
source§impl<D> DigestVerifier<D, Signature> for VerifyingKeywhere
D: Digest + FixedOutput<OutputSize = U32>,
impl<D> DigestVerifier<D, Signature> for VerifyingKeywhere D: Digest + FixedOutput<OutputSize = U32>,
source§impl From<&PublicKey<Secp256k1>> for VerifyingKey
impl From<&PublicKey<Secp256k1>> for VerifyingKey
source§fn from(public_key: &PublicKey) -> VerifyingKey
fn from(public_key: &PublicKey) -> 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> for EncodedPoint
impl From<&VerifyingKey> for EncodedPoint
source§fn from(verifying_key: &VerifyingKey) -> EncodedPoint
fn from(verifying_key: &VerifyingKey) -> EncodedPoint
Converts to this type from the input type.
source§impl From<&VerifyingKey> for ProjectivePoint
impl From<&VerifyingKey> for ProjectivePoint
source§fn from(verifying_key: &VerifyingKey) -> ProjectivePoint
fn from(verifying_key: &VerifyingKey) -> ProjectivePoint
Converts to this type from the input type.
source§impl From<&VerifyingKey> for PublicKey
impl From<&VerifyingKey> for PublicKey
source§fn from(verifying_key: &VerifyingKey) -> PublicKey
fn from(verifying_key: &VerifyingKey) -> PublicKey
Converts to this type from the input type.
source§impl From<PublicKey<Secp256k1>> for VerifyingKey
impl From<PublicKey<Secp256k1>> for VerifyingKey
source§fn from(public_key: PublicKey) -> VerifyingKey
fn from(public_key: PublicKey) -> 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 From<VerifyingKey> for ProjectivePoint
impl From<VerifyingKey> for ProjectivePoint
source§fn from(verifying_key: VerifyingKey) -> ProjectivePoint
fn from(verifying_key: VerifyingKey) -> ProjectivePoint
Converts to this type from the input type.
source§impl From<VerifyingKey> for PublicKey
impl From<VerifyingKey> for PublicKey
source§fn from(verifying_key: VerifyingKey) -> PublicKey
fn from(verifying_key: VerifyingKey) -> PublicKey
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<VerifyingKey> for VerifyingKey
impl PartialEq<VerifyingKey> for VerifyingKey
source§fn eq(&self, other: &VerifyingKey) -> bool
fn eq(&self, other: &VerifyingKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<VerifyingKey> for VerifyingKey
impl PartialOrd<VerifyingKey> for VerifyingKey
source§fn partial_cmp(&self, other: &VerifyingKey) -> Option<Ordering>
fn partial_cmp(&self, other: &VerifyingKey) -> Option<Ordering>
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 moresource§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
fn to_encoded_point(&self, compress: bool) -> EncodedPoint
Serialize this value as a SEC1
EncodedPoint
, optionally applying
point compression.source§impl TryFrom<&AffinePoint> for VerifyingKey
impl TryFrom<&AffinePoint> for VerifyingKey
source§fn try_from(affine_point: &AffinePoint) -> Result<VerifyingKey, Error>
fn try_from(affine_point: &AffinePoint) -> Result<VerifyingKey, Error>
Performs the conversion.
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§fn try_from(point: &ProjectivePoint) -> Result<VerifyingKey, Error>
fn try_from(point: &ProjectivePoint) -> Result<VerifyingKey, Error>
Performs the conversion.
source§impl TryFrom<AffinePoint> for VerifyingKey
impl TryFrom<AffinePoint> for VerifyingKey
source§fn try_from(affine_point: AffinePoint) -> Result<VerifyingKey, Error>
fn try_from(affine_point: AffinePoint) -> Result<VerifyingKey, Error>
Performs the conversion.
source§impl TryFrom<ProjectivePoint> for VerifyingKey
impl TryFrom<ProjectivePoint> for VerifyingKey
source§fn try_from(point: ProjectivePoint) -> Result<VerifyingKey, Error>
fn try_from(point: ProjectivePoint) -> Result<VerifyingKey, Error>
Performs the conversion.
source§impl<S> Verifier<S> for VerifyingKeywhere
S: PrehashSignature,
Self: DigestVerifier<S::Digest, S>,
impl<S> Verifier<S> for VerifyingKeywhere S: PrehashSignature, Self: DigestVerifier<S::Digest, S>,
impl Copy for VerifyingKey
impl Eq for VerifyingKey
impl StructuralEq for VerifyingKey
impl StructuralPartialEq for VerifyingKey
Auto Trait Implementations§
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