Struct ecdsa::VerifyingKey [−][src]
pub struct VerifyingKey<C> where
C: Curve + ProjectiveArithmetic, { /* fields omitted */ }
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.
Implementations
impl<C> VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
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, D> DigestVerifier<D, Signature<C>> for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
D: Digest<OutputSize = FieldSize<C>>,
AffinePoint<C>: VerifyPrimitive<C>,
Scalar<C>: FromDigest<C>,
SignatureSize<C>: ArrayLength<u8>,
impl<C, D> DigestVerifier<D, Signature<C>> for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
D: Digest<OutputSize = FieldSize<C>>,
AffinePoint<C>: VerifyPrimitive<C>,
Scalar<C>: FromDigest<C>,
SignatureSize<C>: ArrayLength<u8>,
Verify the signature against the given [Digest
] output.
Performs the conversion.
impl<C> From<&'_ SigningKey<C>> for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
Scalar<C>: FromDigest<C> + Invert<Output = Scalar<C>> + SignPrimitive<C> + Zeroize,
SignatureSize<C>: ArrayLength<u8>,
impl<C> From<&'_ SigningKey<C>> for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
Scalar<C>: FromDigest<C> + Invert<Output = Scalar<C>> + SignPrimitive<C> + Zeroize,
SignatureSize<C>: ArrayLength<u8>,
Performs the conversion.
impl<C> From<&'_ VerifyingKey<C>> for EncodedPoint<C> where
C: Curve + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> From<&'_ VerifyingKey<C>> for EncodedPoint<C> where
C: Curve + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
impl<C> FromPublicKey for VerifyingKey<C> where
C: Curve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
This is supported on crate feature pkcs8
only.
impl<C> FromPublicKey for VerifyingKey<C> where
C: Curve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
pkcs8
only.Parse SubjectPublicKeyInfo
into a public key object.
Deserialize object from ASN.1 DER-encoded SubjectPublicKeyInfo
(binary format). Read more
Deserialize PKCS#8 private key from a PrivateKeyDocument
.
Deserialize PEM-encoded SubjectPublicKeyInfo
. Read more
impl<C> FromStr for VerifyingKey<C> where
C: Curve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
This is supported on crate feature pem
only.
impl<C> FromStr for VerifyingKey<C> where
C: Curve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
pem
only.impl<C> Ord for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> Ord for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> PartialEq<VerifyingKey<C>> for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> PartialEq<VerifyingKey<C>> for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> PartialOrd<VerifyingKey<C>> for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> PartialOrd<VerifyingKey<C>> for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
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> TryFrom<&'_ [u8]> for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> TryFrom<&'_ [u8]> for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> Verifier<Signature<C>> for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic + DigestPrimitive,
C::Digest: Digest<OutputSize = FieldSize<C>>,
AffinePoint<C>: VerifyPrimitive<C>,
Scalar<C>: FromDigest<C>,
SignatureSize<C>: ArrayLength<u8>,
impl<C> Verifier<Signature<C>> for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic + DigestPrimitive,
C::Digest: Digest<OutputSize = FieldSize<C>>,
AffinePoint<C>: VerifyPrimitive<C>,
Scalar<C>: FromDigest<C>,
SignatureSize<C>: ArrayLength<u8>,
impl<C> Eq for VerifyingKey<C> where
C: Curve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<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
type Output = T
type Output = T
Should always be Self