pub struct PasskeyCapabilityVerifier { /* private fields */ }Expand description
Kernel-side verifier for PasskeyCapability envelopes.
The verifier is configured with the audience the kernel pins itself
to, and the issuer’s public key (the public half of the
chio_core_types::crypto::SigningBackend the issuer used to sign
the capability). The verifier is Send + Sync and stateless;
production deployments hold one in an Arc<> and re-use it across
every kernel call.
Implementations§
Source§impl PasskeyCapabilityVerifier
impl PasskeyCapabilityVerifier
Sourcepub fn new(audience: impl Into<String>, issuer_public_key: PublicKey) -> Self
pub fn new(audience: impl Into<String>, issuer_public_key: PublicKey) -> Self
Build a verifier pinned to a kernel audience and the issuer public key.
Sourcepub fn issuer_public_key(&self) -> &PublicKey
pub fn issuer_public_key(&self) -> &PublicKey
Configured issuer public key.
Sourcepub fn verify(
&self,
capability: &PasskeyCapability,
now: DateTime<Utc>,
) -> Result<(), CustodyError>
pub fn verify( &self, capability: &PasskeyCapability, now: DateTime<Utc>, ) -> Result<(), CustodyError>
Verify a PasskeyCapability presented to this kernel.
Returns Ok(()) only when ALL four gates pass:
capability.signatureis non-empty.capability.audience == self.audience.now < capability.exp.- The detached hex-encoded
capability.signatureverifies underSelf::issuer_public_keyover the canonical-JSON bytes of the envelope WITHsignature = ""(the same message the issuer signed).
Fail-closed: any failing gate returns a typed CustodyError.
The first failing gate short-circuits; deployments that need
distinct telemetry per gate read the CustodyError::urn.
Auto Trait Implementations§
impl Freeze for PasskeyCapabilityVerifier
impl RefUnwindSafe for PasskeyCapabilityVerifier
impl Send for PasskeyCapabilityVerifier
impl Sync for PasskeyCapabilityVerifier
impl Unpin for PasskeyCapabilityVerifier
impl UnsafeUnpin for PasskeyCapabilityVerifier
impl UnwindSafe for PasskeyCapabilityVerifier
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more