[][src]Struct jwt_compact_preview::alg::Es256

pub struct Es256<R: CryptoRng + RngCore> { /* fields omitted */ }

Algorithm implementing elliptic curve digital signatures (ECDSA) on the secp256k1 curve.

The algorithm does not fix the choice of the message digest algorithm; instead, it is provided as a type parameter. SHA-256 is the default parameter value, but it can be set to any cryptographically secure hash function with 32-byte output (e.g., SHA3-256).

This type is available if the crate is built with the k256 feature.

Implementations

impl<R: CryptoRng + RngCore> Es256<R>[src]

pub fn new(rng: R) -> Self[src]

Create an Es256 structure that uses the provided RNG

impl<R: CryptoRng + RngCore> Es256<R>[src]

pub fn generate(&mut self) -> (Es256SigningKey, Es256VerifyingKey)[src]

Generate a new key pair.

Trait Implementations

impl<R: CryptoRng + RngCore> Algorithm for Es256<R>[src]

type SigningKey = Es256SigningKey

Key used when issuing new tokens.

type VerifyingKey = Es256VerifyingKey

Key used when verifying tokens. May coincide with SigningKey for symmetric algorithms (e.g., HS*). Read more

type Signature = Signature

Signature produced by the algorithm.

impl<R: Debug + CryptoRng + RngCore> Debug for Es256<R>[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for Es256<R> where
    R: RefUnwindSafe

impl<R> Send for Es256<R> where
    R: Send

impl<R> Sync for Es256<R> where
    R: Sync

impl<R> Unpin for Es256<R> where
    R: Unpin

impl<R> UnwindSafe for Es256<R> where
    R: UnwindSafe

Blanket Implementations

impl<T> Algorithm for T where
    T: RsaVariant, 
[src]

type SigningKey = RsaSigningKey

Key used when issuing new tokens.

type VerifyingKey = RsaVerifyingKey

Key used when verifying tokens. May coincide with SigningKey for symmetric algorithms (e.g., HS*). Read more

type Signature = Signature

Signature produced by the algorithm.

impl<A> AlgorithmExt for A where
    A: Algorithm
[src]

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> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,