Struct product_os_security::JWTGenerator
source · pub struct JWTGenerator { /* private fields */ }
Implementations§
source§impl JWTGenerator
impl JWTGenerator
pub fn new( gen: Option<RNG>, func: Option<fn() -> DateTime<Utc>>, issuer: String, default_until: i64, default_audience: String, jti_length: usize ) -> Self
pub fn get_default_until(&self) -> &i64
pub fn get_default_audience(&self) -> String
pub fn generate_default_claims( &self, subject: String, audience: Option<String>, jwt_id: String ) -> DefaultClaims
pub fn jwt_auth<'a, T: TokenClaims<'a, T> + Serialize>( &mut self, subject: String, audience: Option<String>, until: Option<DateTime<Utc>>, custom_claims: Option<T>, custom_header: Option<Header>, jwt_secret: &[u8], encryption_key: Option<Vec<u8>>, gen: &mut Option<impl RngCore> ) -> Result<(String, String), JWTError>
pub fn jwt_get_token_claims<'a, T: TokenClaims<'a, T> + DeserializeOwned>( &self, token: String, jwt_secret: &[u8], nonce: &[u8], decryption_key: Option<Vec<u8>> ) -> Result<(String, Token<T>), JWTError>
pub fn jwt_verify_auth<'a, T: TokenClaims<'a, T> + DeserializeOwned>( &self, verify_claims: T, token: String, jwt_secret: &[u8], nonce: &[u8], decryption_key: Option<Vec<u8>> ) -> Result<(String, T), JWTError>
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