Struct k256::ecdsa::VerifyingKey
source · [−]pub struct VerifyingKey { /* private fields */ }ecdsa-core and ecdsa only.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
sourceimpl 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
sourceimpl Clone for VerifyingKey
impl Clone for VerifyingKey
sourcefn clone(&self) -> VerifyingKey
fn clone(&self) -> VerifyingKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for VerifyingKey
impl Debug for VerifyingKey
sourceimpl DecodePublicKey for VerifyingKey
Available on crate feature pkcs8 only.
impl DecodePublicKey for VerifyingKey
pkcs8 only.sourceimpl<D> DigestVerifier<D, Signature<Secp256k1>> for VerifyingKey where
D: Digest + FixedOutput<OutputSize = U32>,
impl<D> DigestVerifier<D, Signature<Secp256k1>> for VerifyingKey where
D: Digest + FixedOutput<OutputSize = U32>,
sourceimpl<D> DigestVerifier<D, Signature> for VerifyingKey where
D: Digest + FixedOutput<OutputSize = U32>,
impl<D> DigestVerifier<D, Signature> for VerifyingKey where
D: Digest + FixedOutput<OutputSize = U32>,
sourceimpl From<&'_ PublicKey<Secp256k1>> for VerifyingKey
impl From<&'_ PublicKey<Secp256k1>> for VerifyingKey
sourcefn from(public_key: &PublicKey) -> VerifyingKey
fn from(public_key: &PublicKey) -> VerifyingKey
Converts to this type from the input type.
sourceimpl From<&'_ SigningKey> for VerifyingKey
impl From<&'_ SigningKey> for VerifyingKey
sourcefn from(signing_key: &SigningKey) -> VerifyingKey
fn from(signing_key: &SigningKey) -> VerifyingKey
Converts to this type from the input type.
sourceimpl From<&'_ VerifyingKey> for PublicKey
impl From<&'_ VerifyingKey> for PublicKey
sourcefn from(verifying_key: &VerifyingKey) -> PublicKey
fn from(verifying_key: &VerifyingKey) -> PublicKey
Converts to this type from the input type.
sourceimpl From<&'_ VerifyingKey> for EncodedPoint
impl From<&'_ VerifyingKey> for EncodedPoint
sourcefn from(verifying_key: &VerifyingKey) -> EncodedPoint
fn from(verifying_key: &VerifyingKey) -> EncodedPoint
Converts to this type from the input type.
sourceimpl From<&'_ VerifyingKey> for ProjectivePoint
impl From<&'_ VerifyingKey> for ProjectivePoint
sourcefn from(verifying_key: &VerifyingKey) -> ProjectivePoint
fn from(verifying_key: &VerifyingKey) -> ProjectivePoint
Converts to this type from the input type.
sourceimpl From<PublicKey<Secp256k1>> for VerifyingKey
impl From<PublicKey<Secp256k1>> for VerifyingKey
sourcefn from(public_key: PublicKey) -> VerifyingKey
fn from(public_key: PublicKey) -> VerifyingKey
Converts to this type from the input type.
sourceimpl From<SigningKey> for VerifyingKey
impl From<SigningKey> for VerifyingKey
sourcefn from(signing_key: SigningKey) -> VerifyingKey
fn from(signing_key: SigningKey) -> VerifyingKey
Converts to this type from the input type.
sourceimpl From<VerifyingKey<Secp256k1>> for VerifyingKey
impl From<VerifyingKey<Secp256k1>> for VerifyingKey
sourcefn from(verifying_key: VerifyingKey<Secp256k1>) -> VerifyingKey
fn from(verifying_key: VerifyingKey<Secp256k1>) -> VerifyingKey
Converts to this type from the input type.
sourceimpl From<VerifyingKey> for PublicKey
impl From<VerifyingKey> for PublicKey
sourcefn from(verifying_key: VerifyingKey) -> PublicKey
fn from(verifying_key: VerifyingKey) -> PublicKey
Converts to this type from the input type.
sourceimpl From<VerifyingKey> for ProjectivePoint
impl From<VerifyingKey> for ProjectivePoint
sourcefn from(verifying_key: VerifyingKey) -> ProjectivePoint
fn from(verifying_key: VerifyingKey) -> ProjectivePoint
Converts to this type from the input type.
sourceimpl Ord for VerifyingKey
impl Ord for VerifyingKey
sourceimpl PartialEq<VerifyingKey> for VerifyingKey
impl PartialEq<VerifyingKey> for VerifyingKey
sourcefn 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 ==. Read more
sourcefn ne(&self, other: &VerifyingKey) -> bool
fn ne(&self, other: &VerifyingKey) -> bool
This method tests for !=.
sourceimpl PartialOrd<VerifyingKey> for VerifyingKey
impl PartialOrd<VerifyingKey> for VerifyingKey
sourcefn partial_cmp(&self, other: &VerifyingKey) -> Option<Ordering>
fn partial_cmp(&self, other: &VerifyingKey) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn 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
sourceimpl ToEncodedPoint<Secp256k1> for VerifyingKey
impl ToEncodedPoint<Secp256k1> for VerifyingKey
sourcefn 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
sourceimpl TryFrom<&'_ AffinePoint> for VerifyingKey
impl TryFrom<&'_ AffinePoint> for VerifyingKey
sourcefn try_from(affine_point: &AffinePoint) -> Result<VerifyingKey, Error>
fn try_from(affine_point: &AffinePoint) -> Result<VerifyingKey, Error>
Performs the conversion.
sourceimpl TryFrom<&'_ EncodedPoint<<<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>> for VerifyingKey
impl TryFrom<&'_ EncodedPoint<<<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>> for VerifyingKey
sourceimpl TryFrom<&'_ ProjectivePoint> for VerifyingKey
impl TryFrom<&'_ ProjectivePoint> for VerifyingKey
sourcefn try_from(point: &ProjectivePoint) -> Result<VerifyingKey, Error>
fn try_from(point: &ProjectivePoint) -> Result<VerifyingKey, Error>
Performs the conversion.
sourceimpl TryFrom<AffinePoint> for VerifyingKey
impl TryFrom<AffinePoint> for VerifyingKey
sourcefn try_from(affine_point: AffinePoint) -> Result<VerifyingKey, Error>
fn try_from(affine_point: AffinePoint) -> Result<VerifyingKey, Error>
Performs the conversion.
sourceimpl TryFrom<ProjectivePoint> for VerifyingKey
impl TryFrom<ProjectivePoint> for VerifyingKey
sourcefn try_from(point: ProjectivePoint) -> Result<VerifyingKey, Error>
fn try_from(point: ProjectivePoint) -> Result<VerifyingKey, Error>
Performs the conversion.
sourceimpl TryFrom<SubjectPublicKeyInfo<'_>> for VerifyingKey
Available on crate feature pkcs8 only.
impl TryFrom<SubjectPublicKeyInfo<'_>> for VerifyingKey
pkcs8 only.sourceimpl<S> Verifier<S> for VerifyingKey where
S: PrehashSignature,
Self: DigestVerifier<S::Digest, S>,
impl<S> Verifier<S> for VerifyingKey where
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
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)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more