#[non_exhaustive]pub enum JwtKeyMaterial {
Hs256Internal {
secret: SecretString,
},
Asymmetric {
algorithm: AsymmetricAlgorithm,
keys: KeyPair,
},
}Expand description
Key material used to sign and verify JWTs.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Hs256Internal
Explicit internal-only HMAC secret.
Fields
§
secret: SecretStringShared secret used for signing and verification.
Asymmetric
Asymmetric PEM key pair (RS256, ES256, or EdDSA).
Fields
§
algorithm: AsymmetricAlgorithmWhich asymmetric algorithm this key pair is for.
Implementations§
Source§impl JwtKeyMaterial
impl JwtKeyMaterial
Sourcepub const fn algorithm(&self) -> JwtAlgorithm
pub const fn algorithm(&self) -> JwtAlgorithm
Return the algorithm implied by the key material.
Trait Implementations§
Source§impl Clone for JwtKeyMaterial
impl Clone for JwtKeyMaterial
Source§fn clone(&self) -> JwtKeyMaterial
fn clone(&self) -> JwtKeyMaterial
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JwtKeyMaterial
impl Debug for JwtKeyMaterial
Source§impl<'de> Deserialize<'de> for JwtKeyMaterial
impl<'de> Deserialize<'de> for JwtKeyMaterial
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 Drop for JwtKeyMaterial
impl Drop for JwtKeyMaterial
Auto Trait Implementations§
impl Freeze for JwtKeyMaterial
impl RefUnwindSafe for JwtKeyMaterial
impl Send for JwtKeyMaterial
impl Sync for JwtKeyMaterial
impl Unpin for JwtKeyMaterial
impl UnsafeUnpin for JwtKeyMaterial
impl UnwindSafe for JwtKeyMaterial
Blanket Implementations§
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