#[non_exhaustive]pub enum SigningKey {
Hs256(Zeroizing<Vec<u8>>),
Hs384(Zeroizing<Vec<u8>>),
Hs512(Zeroizing<Vec<u8>>),
Rs256Pem(String),
Rs384Pem(String),
Rs512Pem(String),
Rs256Components {
n: String,
e: String,
},
}Expand description
Signing key for JWT signature verification.
Supports both symmetric (HS256) and asymmetric (RS256/RS384/RS512) algorithms.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Hs256(Zeroizing<Vec<u8>>)
HMAC-SHA256 symmetric key.
Use for internal services where the same secret is shared between token issuer and validator.
Hs384(Zeroizing<Vec<u8>>)
HMAC-SHA384 symmetric key.
Hs512(Zeroizing<Vec<u8>>)
HMAC-SHA512 symmetric key.
Rs256Pem(String)
RSA public key in PEM format (RS256 algorithm).
Use for external identity providers. The public key is used to verify tokens signed with the provider’s private key.
Rs384Pem(String)
RSA public key in PEM format (RS384 algorithm).
Rs512Pem(String)
RSA public key in PEM format (RS512 algorithm).
Rs256Components
RSA public key components (n, e) for RS256.
Use when receiving keys from JWKS endpoints.
Implementations§
Source§impl SigningKey
impl SigningKey
Sourcepub fn hs256_bytes(secret: &[u8]) -> Self
pub fn hs256_bytes(secret: &[u8]) -> Self
Create an HS256 signing key from raw bytes.
Sourcepub fn rs256_components(n: &str, e: &str) -> Self
pub fn rs256_components(n: &str, e: &str) -> Self
Create an RS256 signing key from RSA components.
This is useful when parsing JWKS responses.
Trait Implementations§
Source§impl Clone for SigningKey
impl Clone for SigningKey
Source§fn clone(&self) -> SigningKey
fn clone(&self) -> SigningKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SigningKey
impl RefUnwindSafe for SigningKey
impl Send for SigningKey
impl Sync for SigningKey
impl Unpin for SigningKey
impl UnsafeUnpin for SigningKey
impl UnwindSafe for SigningKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 more