Struct elliptic_curve::JwkEcKey[][src]

pub struct JwkEcKey { /* fields omitted */ }
This is supported on crate feature jwk only.

JWK elliptic curve keys with a kty of "EC".

They can represent either a public/private keypair, or just a public key, depending on whether or not the d parameter is present.

Implementations

impl JwkEcKey[src]

pub fn crv(&self) -> &str[src]

Get the crv parameter for this JWK.

pub fn is_keypair(&self) -> bool[src]

Is this JWK a keypair that includes a private key?

pub fn is_public_key(&self) -> bool[src]

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>: Copy + Clone + Debug + Default + FromEncodedPoint<C> + ToEncodedPoint<C>,
    ProjectivePoint<C>: From<AffinePoint<C>>,
    Scalar<C>: PrimeField<Repr = FieldBytes<C>>,
    UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
    UncompressedPointSize<C>: ArrayLength<u8>, 
[src]

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 + SecretValue,
    C::Secret: Clone + Zeroize,
    FieldBytes<C>: From<C::Secret>,
    UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
    UncompressedPointSize<C>: ArrayLength<u8>, 
[src]

This is supported on crate feature arithmetic only.

Decode a JWK into a SecretKey.

Trait Implementations

impl Clone for JwkEcKey[src]

impl Debug for JwkEcKey[src]

impl<'de> Deserialize<'de> for JwkEcKey[src]

impl Drop for JwkEcKey[src]

impl Eq for JwkEcKey[src]

impl<C> From<&'_ PublicKey<C>> for JwkEcKey where
    C: Curve + JwkParameters + ProjectiveArithmetic,
    AffinePoint<C>: Copy + Clone + Debug + Default + FromEncodedPoint<C> + ToEncodedPoint<C>,
    ProjectivePoint<C>: From<AffinePoint<C>>,
    Scalar<C>: PrimeField<Repr = FieldBytes<C>>,
    UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
    UncompressedPointSize<C>: ArrayLength<u8>, 
[src]

This is supported on crate feature arithmetic only.

impl<C> From<&'_ SecretKey<C>> for JwkEcKey where
    C: Curve + JwkParameters + ProjectiveArithmetic,
    AffinePoint<C>: Copy + Clone + Debug + Default + FromEncodedPoint<C> + ToEncodedPoint<C>,
    ProjectivePoint<C>: From<AffinePoint<C>>,
    Scalar<C>: PrimeField<Repr = FieldBytes<C>> + Zeroize,
    UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
    UncompressedPointSize<C>: ArrayLength<u8>, 
[src]

This is supported on crate feature arithmetic only.

impl<C> From<PublicKey<C>> for JwkEcKey where
    C: Curve + JwkParameters + ProjectiveArithmetic,
    AffinePoint<C>: Copy + Clone + Debug + Default + FromEncodedPoint<C> + ToEncodedPoint<C>,
    ProjectivePoint<C>: From<AffinePoint<C>>,
    Scalar<C>: PrimeField<Repr = FieldBytes<C>>,
    UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
    UncompressedPointSize<C>: ArrayLength<u8>, 
[src]

This is supported on crate feature arithmetic only.

impl<C> From<SecretKey<C>> for JwkEcKey where
    C: Curve + JwkParameters + ProjectiveArithmetic,
    AffinePoint<C>: Copy + Clone + Debug + Default + FromEncodedPoint<C> + ToEncodedPoint<C>,
    ProjectivePoint<C>: From<AffinePoint<C>>,
    Scalar<C>: PrimeField<Repr = FieldBytes<C>> + Zeroize,
    UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
    UncompressedPointSize<C>: ArrayLength<u8>, 
[src]

This is supported on crate feature arithmetic only.

impl FromStr for JwkEcKey[src]

type Err = Error

The associated error which can be returned from parsing.

impl PartialEq<JwkEcKey> for JwkEcKey[src]

impl Serialize for JwkEcKey[src]

impl ToString for JwkEcKey[src]

impl<C> TryFrom<&'_ EncodedPoint<C>> for JwkEcKey where
    C: Curve + JwkParameters,
    UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
    UncompressedPointSize<C>: ArrayLength<u8>, 
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<C> TryFrom<&'_ JwkEcKey> for EncodedPoint<C> where
    C: Curve + JwkParameters,
    UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
    UncompressedPointSize<C>: ArrayLength<u8>, 
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<C> TryFrom<&'_ JwkEcKey> for SecretKey<C> where
    C: Curve + JwkParameters + ValidatePublicKey + SecretValue,
    C::Secret: Clone + Zeroize,
    FieldBytes<C>: From<C::Secret>,
    UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
    UncompressedPointSize<C>: ArrayLength<u8>, 
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<C> TryFrom<&'_ JwkEcKey> for PublicKey<C> where
    C: Curve + JwkParameters + ProjectiveArithmetic,
    AffinePoint<C>: Copy + Clone + Debug + Default + FromEncodedPoint<C> + ToEncodedPoint<C>,
    ProjectivePoint<C>: From<AffinePoint<C>>,
    Scalar<C>: PrimeField<Repr = FieldBytes<C>>,
    UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
    UncompressedPointSize<C>: ArrayLength<u8>, 
[src]

This is supported on crate feature arithmetic only.

type Error = Error

The type returned in the event of a conversion error.

impl<C> TryFrom<EncodedPoint<C>> for JwkEcKey where
    C: Curve + JwkParameters,
    UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
    UncompressedPointSize<C>: ArrayLength<u8>, 
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<C> TryFrom<JwkEcKey> for EncodedPoint<C> where
    C: Curve + JwkParameters,
    UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
    UncompressedPointSize<C>: ArrayLength<u8>, 
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<C> TryFrom<JwkEcKey> for SecretKey<C> where
    C: Curve + JwkParameters + ValidatePublicKey + SecretValue,
    C::Secret: Clone + Zeroize,
    FieldBytes<C>: From<C::Secret>,
    UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
    UncompressedPointSize<C>: ArrayLength<u8>, 
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<C> TryFrom<JwkEcKey> for PublicKey<C> where
    C: Curve + JwkParameters + ProjectiveArithmetic,
    AffinePoint<C>: Copy + Clone + Debug + Default + FromEncodedPoint<C> + ToEncodedPoint<C>,
    ProjectivePoint<C>: From<AffinePoint<C>>,
    Scalar<C>: PrimeField<Repr = FieldBytes<C>>,
    UntaggedPointSize<C>: Add<U1> + ArrayLength<u8>,
    UncompressedPointSize<C>: ArrayLength<u8>, 
[src]

This is supported on crate feature arithmetic only.

type Error = Error

The type returned in the event of a conversion error.

impl Zeroize for JwkEcKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.