pub struct VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,{ /* private fields */ }
Available on crate feature
verify
only.Expand description
ECDSA verification key (i.e. public key). Generic over elliptic curves.
Requires an elliptic_curve_flow::ProjectiveArithmetic
impl on the curve, and a
VerifyPrimitive
impl on its associated AffinePoint
type.
Implementations§
Source§impl<C> VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
Sourcepub fn from_sec1_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_sec1_bytes(bytes: &[u8]) -> Result<Self>
Initialize VerifyingKey
from a SEC1-encoded public key.
Sourcepub fn from_encoded_point(public_key: &EncodedPoint<C>) -> Result<Self>
pub fn from_encoded_point(public_key: &EncodedPoint<C>) -> Result<Self>
Initialize VerifyingKey
from an EncodedPoint
.
Sourcepub fn to_encoded_point(&self, compress: bool) -> EncodedPoint<C>
pub fn to_encoded_point(&self, compress: bool) -> EncodedPoint<C>
Serialize this VerifyingKey
as a SEC1 EncodedPoint
, optionally
applying point compression.
Trait Implementations§
Source§impl<C> Clone for VerifyingKey<C>
impl<C> Clone for VerifyingKey<C>
Source§fn clone(&self) -> VerifyingKey<C>
fn clone(&self) -> VerifyingKey<C>
Returns a duplicate 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<C> Debug for VerifyingKey<C>
impl<C> Debug for VerifyingKey<C>
Source§impl<C, D> DigestVerifier<D, Signature<C>> for VerifyingKey<C>where
C: PrimeCurve + 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: PrimeCurve + ProjectiveArithmetic,
D: Digest<OutputSize = FieldSize<C>>,
AffinePoint<C>: VerifyPrimitive<C>,
Scalar<C>: FromDigest<C>,
SignatureSize<C>: ArrayLength<u8>,
Source§impl<C> From<&PublicKey<C>> for VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
impl<C> From<&PublicKey<C>> for VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
Source§fn from(public_key: &PublicKey<C>) -> VerifyingKey<C>
fn from(public_key: &PublicKey<C>) -> VerifyingKey<C>
Converts to this type from the input type.
Source§impl<C> From<&SigningKey<C>> for VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
Scalar<C>: FromDigest<C> + Invert<Output = Scalar<C>> + SignPrimitive<C>,
SignatureSize<C>: ArrayLength<u8>,
impl<C> From<&SigningKey<C>> for VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
Scalar<C>: FromDigest<C> + Invert<Output = Scalar<C>> + SignPrimitive<C>,
SignatureSize<C>: ArrayLength<u8>,
Source§fn from(signing_key: &SigningKey<C>) -> VerifyingKey<C>
fn from(signing_key: &SigningKey<C>) -> VerifyingKey<C>
Converts to this type from the input type.
Source§impl<C> From<&VerifyingKey<C>> for EncodedPoint<C>where
C: PrimeCurve + 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: PrimeCurve + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
Source§fn from(verifying_key: &VerifyingKey<C>) -> EncodedPoint<C>
fn from(verifying_key: &VerifyingKey<C>) -> EncodedPoint<C>
Converts to this type from the input type.
Source§impl<C> From<&VerifyingKey<C>> for PublicKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
impl<C> From<&VerifyingKey<C>> for PublicKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
Source§fn from(verifying_key: &VerifyingKey<C>) -> PublicKey<C>
fn from(verifying_key: &VerifyingKey<C>) -> PublicKey<C>
Converts to this type from the input type.
Source§impl<C> From<PublicKey<C>> for VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
impl<C> From<PublicKey<C>> for VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
Source§fn from(public_key: PublicKey<C>) -> VerifyingKey<C>
fn from(public_key: PublicKey<C>) -> VerifyingKey<C>
Converts to this type from the input type.
Source§impl<C> From<VerifyingKey<C>> for PublicKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
impl<C> From<VerifyingKey<C>> for PublicKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
Source§fn from(verifying_key: VerifyingKey<C>) -> PublicKey<C>
fn from(verifying_key: VerifyingKey<C>) -> PublicKey<C>
Converts to this type from the input type.
Source§impl<C> FromPublicKey for VerifyingKey<C>where
C: PrimeCurve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
Available on crate feature pkcs8
only.
impl<C> FromPublicKey for VerifyingKey<C>where
C: PrimeCurve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
Available on crate feature
pkcs8
only.Source§fn from_spki(spki: SubjectPublicKeyInfo<'_>) -> Result<Self>
fn from_spki(spki: SubjectPublicKeyInfo<'_>) -> Result<Self>
Parse
SubjectPublicKeyInfo
into a public key object.Source§fn from_public_key_der(bytes: &[u8]) -> Result<Self, Error>
fn from_public_key_der(bytes: &[u8]) -> Result<Self, Error>
Deserialize object from ASN.1 DER-encoded
SubjectPublicKeyInfo
(binary format).Source§fn from_public_key_doc(doc: &PublicKeyDocument) -> Result<Self, Error>
fn from_public_key_doc(doc: &PublicKeyDocument) -> Result<Self, Error>
Deserialize PKCS#8 private key from a
PrivateKeyDocument
.Source§fn from_public_key_pem(s: &str) -> Result<Self, Error>
fn from_public_key_pem(s: &str) -> Result<Self, Error>
Deserialize PEM-encoded
SubjectPublicKeyInfo
. Read moreSource§impl<C> FromStr for VerifyingKey<C>where
C: PrimeCurve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
Available on crate feature pem
only.
impl<C> FromStr for VerifyingKey<C>where
C: PrimeCurve + AlgorithmParameters + ProjectiveArithmetic + PointCompression,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
Available on crate feature
pem
only.Source§impl<C> Ord for VerifyingKey<C>where
C: PrimeCurve + 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: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
Source§impl<C> PartialEq for VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> PartialEq for VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
Source§impl<C> PartialOrd for VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> PartialOrd for VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
Source§impl<C> TryFrom<&[u8]> for VerifyingKey<C>where
C: PrimeCurve + 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: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
Source§impl<C> Verifier<Signature<C>> for VerifyingKey<C>where
C: PrimeCurve + 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: PrimeCurve + ProjectiveArithmetic + DigestPrimitive,
C::Digest: Digest<OutputSize = FieldSize<C>>,
AffinePoint<C>: VerifyPrimitive<C>,
Scalar<C>: FromDigest<C>,
SignatureSize<C>: ArrayLength<u8>,
impl<C> Copy for VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
impl<C> Eq for VerifyingKey<C>where
C: PrimeCurve + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
Auto Trait Implementations§
impl<C> Freeze for VerifyingKey<C>
impl<C> RefUnwindSafe for VerifyingKey<C>
impl<C> Send for VerifyingKey<C>
impl<C> Sync for VerifyingKey<C>
impl<C> Unpin for VerifyingKey<C>
impl<C> UnwindSafe for VerifyingKey<C>
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