pub struct KeySet { /* private fields */ }Expand description
Public keys a token may be verified with (a JWKS)
Implementations§
Source§impl KeySet
impl KeySet
pub fn new() -> Self
Sourcepub fn with(self, key: VerifyingKey) -> Self
pub fn with(self, key: VerifyingKey) -> Self
Add a key
Sourcepub fn from_jwks(json: &str) -> Result<Self>
pub fn from_jwks(json: &str) -> Result<Self>
Parse a JWKS document ({"keys": [...]}). Keys of an unsupported type
(other curves, oct) are skipped; it is an error if none remain.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn decode<T: DeserializeOwned>(
&self,
token: &str,
validation: &Validation,
) -> Result<T>
pub fn decode<T: DeserializeOwned>( &self, token: &str, validation: &Validation, ) -> Result<T>
Verify signature, exp and nbf (and validation) and return the claims
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeySet
impl RefUnwindSafe for KeySet
impl Send for KeySet
impl Sync for KeySet
impl Unpin for KeySet
impl UnsafeUnpin for KeySet
impl UnwindSafe for KeySet
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