Struct elliptic_curve::JwkEcKey
source · [−]pub struct JwkEcKey { /* private fields */ }
This is supported on crate feature
jwk
only.Expand description
JSON Web Key (JWK) with a kty
of "EC"
(elliptic curve).
Specified in RFC 7518 Section 6: Cryptographic Algorithms for Keys.
This type can represent either a public/private keypair, or just a
public key, depending on whether or not the d
parameter is present.
Implementations
Is this JWK a keypair that includes a private key?
Does this JWK contain only a public key?
pub fn to_public_key<C>(&self) -> Result<PublicKey<C>> where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature arithmetic
only.
pub fn to_public_key<C>(&self) -> Result<PublicKey<C>> where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature
arithmetic
only.Decode a JWK into a PublicKey
.
pub fn from_encoded_point<C>(point: &EncodedPoint<C>) -> Option<Self> where
C: Curve + JwkParameters,
FieldSize<C>: ModulusSize,
pub fn from_encoded_point<C>(point: &EncodedPoint<C>) -> Option<Self> where
C: Curve + JwkParameters,
FieldSize<C>: ModulusSize,
Create a JWK from a SEC1 EncodedPoint
.
pub fn to_encoded_point<C>(&self) -> Result<EncodedPoint<C>> where
C: Curve + JwkParameters,
FieldSize<C>: ModulusSize,
pub fn to_encoded_point<C>(&self) -> Result<EncodedPoint<C>> where
C: Curve + JwkParameters,
FieldSize<C>: ModulusSize,
Get the public key component of this JWK as a SEC1 EncodedPoint
.
pub fn to_secret_key<C>(&self) -> Result<SecretKey<C>> where
C: Curve + JwkParameters + ValidatePublicKey,
FieldSize<C>: ModulusSize,
This is supported on crate feature arithmetic
only.
pub fn to_secret_key<C>(&self) -> Result<SecretKey<C>> where
C: Curve + JwkParameters + ValidatePublicKey,
FieldSize<C>: ModulusSize,
This is supported on crate feature
arithmetic
only.Decode a JWK into a SecretKey
.
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
impl<C> From<&'_ PublicKey<C>> for JwkEcKey where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature arithmetic
only.
impl<C> From<&'_ PublicKey<C>> for JwkEcKey where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature
arithmetic
only.impl<C> From<&'_ SecretKey<C>> for JwkEcKey where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature arithmetic
only.
impl<C> From<&'_ SecretKey<C>> for JwkEcKey where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature
arithmetic
only.impl<C> From<PublicKey<C>> for JwkEcKey where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature arithmetic
only.
impl<C> From<PublicKey<C>> for JwkEcKey where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature
arithmetic
only.impl<C> From<SecretKey<C>> for JwkEcKey where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature arithmetic
only.
impl<C> From<SecretKey<C>> for JwkEcKey where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature
arithmetic
only.impl<C> TryFrom<&'_ JwkEcKey> for SecretKey<C> where
C: Curve + JwkParameters + ValidatePublicKey,
FieldSize<C>: ModulusSize,
impl<C> TryFrom<&'_ JwkEcKey> for SecretKey<C> where
C: Curve + JwkParameters + ValidatePublicKey,
FieldSize<C>: ModulusSize,
impl<C> TryFrom<&'_ JwkEcKey> for PublicKey<C> where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature arithmetic
only.
impl<C> TryFrom<&'_ JwkEcKey> for PublicKey<C> where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature
arithmetic
only.impl<C> TryFrom<JwkEcKey> for SecretKey<C> where
C: Curve + JwkParameters + ValidatePublicKey,
FieldSize<C>: ModulusSize,
impl<C> TryFrom<JwkEcKey> for SecretKey<C> where
C: Curve + JwkParameters + ValidatePublicKey,
FieldSize<C>: ModulusSize,
impl<C> TryFrom<JwkEcKey> for PublicKey<C> where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature arithmetic
only.
impl<C> TryFrom<JwkEcKey> for PublicKey<C> where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldSize<C>: ModulusSize,
This is supported on crate feature
arithmetic
only.Auto Trait Implementations
impl RefUnwindSafe for JwkEcKey
impl UnwindSafe for JwkEcKey
Blanket Implementations
Mutably borrows from an owned value. Read more