pub struct JwtGenerator { /* private fields */ }Expand description
Helper to generate JWT tokens
Implementations§
Source§impl JwtGenerator
impl JwtGenerator
Sourcepub fn new(
algorithm: SigningAlgorithm,
length: SigningKeyLength,
key: &str,
) -> Result<Self, GeneratorError>
pub fn new( algorithm: SigningAlgorithm, length: SigningKeyLength, key: &str, ) -> Result<Self, GeneratorError>
Create a new JWT generator. Key must be provided as a PEM with pkcs8 format for RSA and ES algorithms, and plain text for HMAC.
Auto Trait Implementations§
impl Freeze for JwtGenerator
impl !RefUnwindSafe for JwtGenerator
impl !Send for JwtGenerator
impl !Sync for JwtGenerator
impl Unpin for JwtGenerator
impl !UnwindSafe for JwtGenerator
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