pub struct IssuerTrust { /* private fields */ }Expand description
One trusted issuer and the keys that may speak for it. Cheap to clone.
Implementations§
Source§impl IssuerTrust
impl IssuerTrust
Sourcepub fn pinned(
issuer: impl Into<String>,
key: PasetoV4PublicVerifier,
) -> IssuerTrust
pub fn pinned( issuer: impl Into<String>, key: PasetoV4PublicVerifier, ) -> IssuerTrust
Trust issuer as whatever key signs.
Sourcepub fn key_set(issuer: impl Into<String>, keys: KeySetVerifier) -> IssuerTrust
pub fn key_set(issuer: impl Into<String>, keys: KeySetVerifier) -> IssuerTrust
Trust issuer through a JWKS key set: the signing key must be
issuer-role and owned by issuer.
pub fn issuer(&self) -> &str
Sourcepub fn export(&self) -> TrustDoc
pub fn export(&self) -> TrustDoc
The keys this trust verifies with right now, as a persistable document. A JWKS-cache-backed trust exports the cache’s current set.
Sourcepub fn from_doc(doc: TrustDoc) -> Result<IssuerTrust, JwksError>
pub fn from_doc(doc: TrustDoc) -> Result<IssuerTrust, JwksError>
Rebuild a trust from export’s document. Static: it
verifies with exactly the persisted keys and never fetches.
Sourcepub async fn verify<T>(&self, token: &str) -> Result<T, VerifyError>where
T: SignedArtifact,
pub async fn verify<T>(&self, token: &str) -> Result<T, VerifyError>where
T: SignedArtifact,
Verify token as a T signed for this issuer.
Trait Implementations§
Source§impl Clone for IssuerTrust
impl Clone for IssuerTrust
Source§fn clone(&self) -> IssuerTrust
fn clone(&self) -> IssuerTrust
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for IssuerTrust
impl !UnwindSafe for IssuerTrust
impl Freeze for IssuerTrust
impl Send for IssuerTrust
impl Sync for IssuerTrust
impl Unpin for IssuerTrust
impl UnsafeUnpin for IssuerTrust
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