Struct ecdsa::VerifyingKey
source · [−]pub struct VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic, { /* private fields */ }
verify
only.Expand description
ECDSA verification key (i.e. public key). Generic over elliptic curves.
Requires an elliptic_curve::ProjectiveArithmetic
impl on the curve, and a
VerifyPrimitive
impl on its associated AffinePoint
type.
serde
support
When the serde
feature of this crate is enabled, it provides support for
serializing and deserializing ECDSA signatures using the Serialize
and
Deserialize
traits.
The serialization leverages the encoding used by the PublicKey
type,
which is a binary-oriented ASN.1 DER encoding.
Implementations
impl<C> VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
impl<C> VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
Initialize VerifyingKey
from a SEC1-encoded public key.
Initialize VerifyingKey
from an EncodedPoint
.
Serialize this VerifyingKey
as a SEC1 EncodedPoint
, optionally
applying point compression.
Trait Implementations
impl<C> DecodePublicKey for VerifyingKey<C> where
C: PrimeCurve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature pkcs8
only.
impl<C> DecodePublicKey for VerifyingKey<C> where
C: PrimeCurve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
pkcs8
only.Deserialize object from ASN.1 DER-encoded SubjectPublicKeyInfo
(binary format). Read more
Deserialize SPKI public key from a PublicKeyDocument
.
Deserialize PEM-encoded SubjectPublicKeyInfo
. Read more
impl<'de, C> Deserialize<'de> for VerifyingKey<C> where
C: PrimeCurve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate features pem
and serde
only.
impl<'de, C> Deserialize<'de> for VerifyingKey<C> where
C: PrimeCurve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
pem
and serde
only.Deserialize this value from the given Serde deserializer. Read more
impl<C, D> DigestVerifier<D, Signature<C>> for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
D: Digest + FixedOutput<OutputSize = FieldSize<C>>,
AffinePoint<C>: VerifyPrimitive<C>,
Scalar<C>: Reduce<C::UInt>,
SignatureSize<C>: ArrayLength<u8>,
impl<C, D> DigestVerifier<D, Signature<C>> for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
D: Digest + FixedOutput<OutputSize = FieldSize<C>>,
AffinePoint<C>: VerifyPrimitive<C>,
Scalar<C>: Reduce<C::UInt>,
SignatureSize<C>: ArrayLength<u8>,
impl<C> From<&'_ PublicKey<C>> for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
impl<C> From<&'_ PublicKey<C>> for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
Performs the conversion.
impl<C> From<&'_ SigningKey<C>> for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
Scalar<C>: Invert<Output = CtOption<Scalar<C>>> + Reduce<C::UInt> + SignPrimitive<C>,
SignatureSize<C>: ArrayLength<u8>,
impl<C> From<&'_ SigningKey<C>> for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
Scalar<C>: Invert<Output = CtOption<Scalar<C>>> + Reduce<C::UInt> + SignPrimitive<C>,
SignatureSize<C>: ArrayLength<u8>,
Performs the conversion.
impl<C> From<&'_ VerifyingKey<C>> for EncodedPoint<C> where
C: PrimeCurve + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
impl<C> From<&'_ VerifyingKey<C>> for EncodedPoint<C> where
C: PrimeCurve + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
Performs the conversion.
impl<C> From<&'_ VerifyingKey<C>> for PublicKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
impl<C> From<&'_ VerifyingKey<C>> for PublicKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
Performs the conversion.
Performs the conversion.
Performs the conversion.
impl<C> FromStr for VerifyingKey<C> where
C: PrimeCurve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature pem
only.
impl<C> FromStr for VerifyingKey<C> where
C: PrimeCurve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
pem
only.impl<C> Ord for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
impl<C> Ord for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
impl<C> PartialEq<VerifyingKey<C>> for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
impl<C> PartialEq<VerifyingKey<C>> for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
impl<C> PartialOrd<VerifyingKey<C>> for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
impl<C> PartialOrd<VerifyingKey<C>> for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
impl<C> Serialize for VerifyingKey<C> where
C: PrimeCurve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate features pem
and serde
only.
impl<C> Serialize for VerifyingKey<C> where
C: PrimeCurve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
pem
and serde
only.impl<C> TryFrom<&'_ [u8]> for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
impl<C> TryFrom<&'_ [u8]> for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
impl<C> TryFrom<SubjectPublicKeyInfo<'_>> for VerifyingKey<C> where
C: PrimeCurve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature pkcs8
only.
impl<C> TryFrom<SubjectPublicKeyInfo<'_>> for VerifyingKey<C> where
C: PrimeCurve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
pkcs8
only.impl<C> Verifier<Signature<C>> for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic + DigestPrimitive,
C::Digest: Digest + FixedOutput<OutputSize = FieldSize<C>>,
AffinePoint<C>: VerifyPrimitive<C>,
Scalar<C>: Reduce<C::UInt>,
SignatureSize<C>: ArrayLength<u8>,
impl<C> Verifier<Signature<C>> for VerifyingKey<C> where
C: PrimeCurve + ProjectiveArithmetic + DigestPrimitive,
C::Digest: Digest + FixedOutput<OutputSize = FieldSize<C>>,
AffinePoint<C>: VerifyPrimitive<C>,
Scalar<C>: Reduce<C::UInt>,
SignatureSize<C>: ArrayLength<u8>,
Auto Trait Implementations
impl<C> RefUnwindSafe for VerifyingKey<C> where
<C as AffineArithmetic>::AffinePoint: RefUnwindSafe,
impl<C> Send for VerifyingKey<C>
impl<C> Sync for VerifyingKey<C>
impl<C> Unpin for VerifyingKey<C> where
<C as AffineArithmetic>::AffinePoint: Unpin,
impl<C> UnwindSafe for VerifyingKey<C> where
<C as AffineArithmetic>::AffinePoint: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more