pub struct Ed25519;Expand description
Integrity algorithm using digital signatures on the Ed25519 elliptic curve.
The name of the algorithm is specified as EdDSA as per the IANA registry.
Use with_specific_name() to switch to non-standard Ed25519.
Implementations§
Trait Implementations§
Source§impl Algorithm for Ed25519
impl Algorithm for Ed25519
Source§type SigningKey = SigningKey
type SigningKey = SigningKey
Key used when issuing new tokens.
Source§type VerifyingKey = VerifyingKey
type VerifyingKey = VerifyingKey
Key used when verifying tokens. May coincide with
Self::SigningKey for symmetric
algorithms (e.g., HS*).Source§fn name(&self) -> Cow<'static, str>
fn name(&self) -> Cow<'static, str>
Returns the name of this algorithm, as mentioned in the
alg field of the JWT header.Source§impl SigningKey<Ed25519> for SigningKey
impl SigningKey<Ed25519> for SigningKey
Source§fn from_slice(raw: &[u8]) -> Result<SigningKey, Error>
fn from_slice(raw: &[u8]) -> Result<SigningKey, Error>
Creates a key from
raw bytes. Returns an error if the bytes do not represent
a valid key.Source§fn to_verifying_key(&self) -> VerifyingKey
fn to_verifying_key(&self) -> VerifyingKey
Converts a signing key to a verification key.
Source§fn as_bytes(&self) -> SecretBytes<'_>
fn as_bytes(&self) -> SecretBytes<'_>
Returns the key as raw bytes. Read more
Source§impl VerifyingKey<Ed25519> for VerifyingKey
impl VerifyingKey<Ed25519> for VerifyingKey
impl Copy for Ed25519
impl Eq for Ed25519
impl StructuralPartialEq for Ed25519
Auto Trait Implementations§
impl Freeze for Ed25519
impl RefUnwindSafe for Ed25519
impl Send for Ed25519
impl Sync for Ed25519
impl Unpin for Ed25519
impl UnwindSafe for Ed25519
Blanket Implementations§
Source§impl<A> AlgorithmExt for Awhere
A: Algorithm,
impl<A> AlgorithmExt for Awhere
A: Algorithm,
Source§fn token<T>(
&self,
header: &Header<impl Serialize>,
claims: &Claims<T>,
signing_key: &<A as Algorithm>::SigningKey,
) -> Result<String, CreationError>where
T: Serialize,
fn token<T>(
&self,
header: &Header<impl Serialize>,
claims: &Claims<T>,
signing_key: &<A as Algorithm>::SigningKey,
) -> Result<String, CreationError>where
T: Serialize,
Creates a new token and serializes it to string.
Source§fn validator<'a, T>(
&'a self,
verifying_key: &'a <A as Algorithm>::VerifyingKey,
) -> Validator<'a, A, T>
fn validator<'a, T>( &'a self, verifying_key: &'a <A as Algorithm>::VerifyingKey, ) -> Validator<'a, A, T>
Creates a JWT validator for the specified verifying key and the claims type.
The validator can then be used to validate integrity of one or more tokens.
Source§fn validate_integrity<T>(
&self,
token: &UntrustedToken,
verifying_key: &<A as Algorithm>::VerifyingKey,
) -> Result<Token<T>, ValidationError>where
T: DeserializeOwned,
fn validate_integrity<T>(
&self,
token: &UntrustedToken,
verifying_key: &<A as Algorithm>::VerifyingKey,
) -> Result<Token<T>, ValidationError>where
T: DeserializeOwned,
👎Deprecated: Use
.validator().validate() for added flexibilityValidates the token integrity against the provided
verifying_key.Source§fn validate_for_signed_token<T>(
&self,
token: &UntrustedToken,
verifying_key: &<A as Algorithm>::VerifyingKey,
) -> Result<SignedToken<A, T>, ValidationError>where
T: DeserializeOwned,
fn validate_for_signed_token<T>(
&self,
token: &UntrustedToken,
verifying_key: &<A as Algorithm>::VerifyingKey,
) -> Result<SignedToken<A, T>, ValidationError>where
T: DeserializeOwned,
👎Deprecated: Use
.validator().validate_for_signed_token() for added flexibilityValidates the token integrity against the provided
verifying_key. Read moreSource§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
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T. Read moreSource§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
Source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T.