Struct elliptic_curve::JwkEcKey [−][src]
pub struct JwkEcKey { /* fields omitted */ }
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>, Error> where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
This is supported on crate feature arithmetic
only.
pub fn to_public_key<C>(&self) -> Result<PublicKey<C>, Error> where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
This is supported on crate feature
arithmetic
only.Decode a JWK into a PublicKey
.
pub fn to_secret_key<C>(&self) -> Result<SecretKey<C>, Error> where
C: Curve + JwkParameters + ValidatePublicKey,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
This is supported on crate feature arithmetic
only.
pub fn to_secret_key<C>(&self) -> Result<SecretKey<C>, Error> where
C: Curve + JwkParameters + ValidatePublicKey,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
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>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
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>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
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>,
Scalar<C>: Zeroize,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
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>,
Scalar<C>: Zeroize,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
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>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
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>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
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>,
Scalar<C>: Zeroize,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
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>,
Scalar<C>: Zeroize,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
This is supported on crate feature
arithmetic
only.impl<C> TryFrom<&'_ EncodedPoint<C>> for JwkEcKey where
C: Curve + JwkParameters,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> TryFrom<&'_ EncodedPoint<C>> for JwkEcKey where
C: Curve + JwkParameters,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> TryFrom<&'_ JwkEcKey> for EncodedPoint<C> where
C: Curve + JwkParameters,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> TryFrom<&'_ JwkEcKey> for EncodedPoint<C> where
C: Curve + JwkParameters,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> TryFrom<&'_ JwkEcKey> for SecretKey<C> where
C: Curve + JwkParameters + ValidatePublicKey,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> TryFrom<&'_ JwkEcKey> for SecretKey<C> where
C: Curve + JwkParameters + ValidatePublicKey,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> TryFrom<&'_ JwkEcKey> for PublicKey<C> where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
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>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
This is supported on crate feature
arithmetic
only.impl<C> TryFrom<EncodedPoint<C>> for JwkEcKey where
C: Curve + JwkParameters,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> TryFrom<EncodedPoint<C>> for JwkEcKey where
C: Curve + JwkParameters,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> TryFrom<JwkEcKey> for EncodedPoint<C> where
C: Curve + JwkParameters,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> TryFrom<JwkEcKey> for EncodedPoint<C> where
C: Curve + JwkParameters,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> TryFrom<JwkEcKey> for SecretKey<C> where
C: Curve + JwkParameters + ValidatePublicKey,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> TryFrom<JwkEcKey> for SecretKey<C> where
C: Curve + JwkParameters + ValidatePublicKey,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
impl<C> TryFrom<JwkEcKey> for PublicKey<C> where
C: Curve + JwkParameters + ProjectiveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
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>,
UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
UncompressedPointSize<C>: ArrayLength<u8>,
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
type Output = T
type Output = T
Should always be Self