pub struct JwtCodec { /* private fields */ }Expand description
Reusable JWT codec for safe token encoding, header inspection, and validation.
This is the rskit-owned primitive used by JwtService.
Application code can use it when it needs direct JWT operations without
depending on the underlying JWT library.
Implementations§
Source§impl JwtCodec
impl JwtCodec
Sourcepub fn new(config: JwtConfig) -> AppResult<Self>
pub fn new(config: JwtConfig) -> AppResult<Self>
Create a codec from JWT configuration and key material.
§Errors
Returns an error when the issuer/audience policy or key material is invalid.
Sourcepub const fn config(&self) -> &JwtConfig
pub const fn config(&self) -> &JwtConfig
Return this codec’s immutable validation/signing configuration.
Auto Trait Implementations§
impl Freeze for JwtCodec
impl RefUnwindSafe for JwtCodec
impl Send for JwtCodec
impl Sync for JwtCodec
impl Unpin for JwtCodec
impl UnsafeUnpin for JwtCodec
impl UnwindSafe for JwtCodec
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