Struct cataclysm_jwt::jwt_session::JWTRS256Builder
source · pub struct JWTRS256Builder { /* private fields */ }
Expand description
Simple builder for RS256 session
Implementations§
source§impl JWTRS256Builder
impl JWTRS256Builder
sourcepub fn add_verification_key<A: AsRef<str>>(self, key: RS256, kid: A) -> Self
pub fn add_verification_key<A: AsRef<str>>(self, key: RS256, kid: A) -> Self
Adds verification key from prior key RS256
structure. Mostly used if one has an already known key, but it is better to use the add_from_jwks
function
sourcepub async fn add_from_jwks<A: AsRef<str>>(self, url: A) -> Result<Self, Error>
pub async fn add_from_jwks<A: AsRef<str>>(self, url: A) -> Result<Self, Error>
Uses an endpoint to obtain public keys needed for verification from an array of keys. Will ignore any key that does not use RS256 as signing algorithm. Will panic if no key was found with RS256 alg.
sourcepub fn build(self) -> Result<JWTRS256Session, Error>
pub fn build(self) -> Result<JWTRS256Session, Error>
Simple building function
Trait Implementations§
source§impl Default for JWTRS256Builder
impl Default for JWTRS256Builder
source§fn default() -> JWTRS256Builder
fn default() -> JWTRS256Builder
Returns the “default value” for a type. Read more