pub struct ContinuityTokenSigner { /* private fields */ }Expand description
Holds the shared secret + signs / verifies tokens. One signer per process; adopters rotate via the secrets service (§10.f) on the cadence they prefer.
Implementations§
Source§impl ContinuityTokenSigner
impl ContinuityTokenSigner
Sourcepub fn new(key: impl Into<Vec<u8>>) -> Self
pub fn new(key: impl Into<Vec<u8>>) -> Self
Wrap an adopter-supplied secret. Accepts any byte length; 32 bytes of CSPRNG output is the recommended size (matches §10.e signer-key guidance).
Sourcepub fn sign(&self, token: &ContinuityToken) -> String
pub fn sign(&self, token: &ContinuityToken) -> String
Produce the wire-encoded token. The wire format is
base64url_no_pad(session_id || 0x1e || expiry_ms || 0x1e || hex_lower(HMAC-SHA256)),
computed by the C23 kernel in axon-csys.
Sourcepub fn verify(&self, raw: &str) -> Result<ContinuityToken, ContinuityTokenError>
pub fn verify(&self, raw: &str) -> Result<ContinuityToken, ContinuityTokenError>
Verify + parse. Returns the bound ContinuityToken on
success, typed error otherwise.
Trait Implementations§
Source§impl Clone for ContinuityTokenSigner
impl Clone for ContinuityTokenSigner
Source§fn clone(&self) -> ContinuityTokenSigner
fn clone(&self) -> ContinuityTokenSigner
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 Freeze for ContinuityTokenSigner
impl RefUnwindSafe for ContinuityTokenSigner
impl Send for ContinuityTokenSigner
impl Sync for ContinuityTokenSigner
impl Unpin for ContinuityTokenSigner
impl UnsafeUnpin for ContinuityTokenSigner
impl UnwindSafe for ContinuityTokenSigner
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.