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 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<OutputSize = U32>,
impl<D> DigestVerifier<D, Signature<Secp256k1>> for VerifyingKeywhere
D: Digest<OutputSize = U32>,
source§impl<D> DigestVerifier<D, Signature> for VerifyingKeywhere
D: Digest<OutputSize = U32>,
impl<D> DigestVerifier<D, Signature> for VerifyingKeywhere
D: Digest<OutputSize = U32>,
source§impl From<&AffinePoint> for VerifyingKey
impl From<&AffinePoint> for VerifyingKey
source§fn from(affine_point: &AffinePoint) -> VerifyingKey
fn from(affine_point: &AffinePoint) -> VerifyingKey
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> 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 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 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
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 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. Read more