pub enum JwtAlgorithm {
HS256,
HS384,
HS512,
RS256,
RS384,
RS512,
ES256,
ES384,
}Expand description
JWT signing algorithms supported across platforms.
This is a subset of algorithms that work on both native and WASM.
Variants§
HS256
HMAC with SHA-256
HS384
HMAC with SHA-384
HS512
HMAC with SHA-512
RS256
RSA PKCS#1 with SHA-256
RS384
RSA PKCS#1 with SHA-384
RS512
RSA PKCS#1 with SHA-512
ES256
ECDSA with P-256 and SHA-256
ES384
ECDSA with P-384 and SHA-384
Implementations§
Source§impl JwtAlgorithm
impl JwtAlgorithm
Sourcepub fn parse(s: &str) -> Option<Self>
pub fn parse(s: &str) -> Option<Self>
Parse algorithm from string (convenience method)
Returns None if the string is not a recognized algorithm.
For infallible parsing, use str::parse::<JwtAlgorithm>().
Sourcepub fn is_asymmetric(&self) -> bool
pub fn is_asymmetric(&self) -> bool
Check if this is an asymmetric algorithm (RSA or ECDSA)
Sourcepub fn is_symmetric(&self) -> bool
pub fn is_symmetric(&self) -> bool
Check if this is a symmetric algorithm (HMAC)
Trait Implementations§
Source§impl Clone for JwtAlgorithm
impl Clone for JwtAlgorithm
impl Copy for JwtAlgorithm
Source§impl Debug for JwtAlgorithm
impl Debug for JwtAlgorithm
Source§impl<'de> Deserialize<'de> for JwtAlgorithm
impl<'de> Deserialize<'de> for JwtAlgorithm
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for JwtAlgorithm
impl Display for JwtAlgorithm
impl Eq for JwtAlgorithm
Source§impl FromStr for JwtAlgorithm
impl FromStr for JwtAlgorithm
Source§impl Hash for JwtAlgorithm
impl Hash for JwtAlgorithm
Source§impl PartialEq for JwtAlgorithm
impl PartialEq for JwtAlgorithm
Source§impl Serialize for JwtAlgorithm
impl Serialize for JwtAlgorithm
impl StructuralPartialEq for JwtAlgorithm
Auto Trait Implementations§
impl Freeze for JwtAlgorithm
impl RefUnwindSafe for JwtAlgorithm
impl Send for JwtAlgorithm
impl Sync for JwtAlgorithm
impl Unpin for JwtAlgorithm
impl UnsafeUnpin for JwtAlgorithm
impl UnwindSafe for JwtAlgorithm
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<E> IntoToolError for Ewhere
E: Display,
impl<E> IntoToolError for Ewhere
E: Display,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
impl<T> MaybeSend for T
impl<T> MaybeSync for T
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.