Skip to main content

UrlTokenKeys

Struct UrlTokenKeys 

Source
pub struct UrlTokenKeys { /* private fields */ }
Expand description

The deployment’s URL-token signing key and its retired verification keys (§9.4). Only key ids appear in Debug; seeds never do.

Implementations§

Source§

impl UrlTokenKeys

Source

pub fn contains_secret(&self, material: &[u8; 32]) -> bool

Check candidate role material without exposing the active signing seed.

Source

pub fn new( active_seed: Zeroizing<[u8; 32]>, retired: Vec<RetiredKey>, ) -> Result<Self, UrlTokenConfigError>

Signing active seed plus the retired verification set.

§Errors

UrlTokenConfigError::Keys for a malformed or weak retired public key, a retired key equal to the active key, or a duplicate key id.

Source

pub fn parse_key_file(text: &str) -> Result<Self, UrlTokenConfigError>

Parse a key file: blank lines and # comments are ignored; exactly one active <64 hex seed> line and zero or more retired <64 hex public key> <retired_at_ms> lines follow the §3.1 decimal and hex rules. Errors never echo input.

§Errors

As UrlTokenKeys::new, plus malformed lines.

Source

pub fn parse_key_file_secret(text: String) -> Result<Self, UrlTokenConfigError>

Self::parse_key_file over an owned secret, wiping the source text.

§Errors

As UrlTokenKeys::parse_key_file.

Source

pub fn active_key_id(&self) -> String

The active key’s id: hex(blake3(public)[..16]).

Source

pub fn public_keys(&self) -> impl Iterator<Item = [u8; 32]> + '_

Active and retained public keys for deployment role-separation checks. This never exposes seeds; adapters compare hook/enc/receipt/admin keys.

Source

pub fn key_set_json(&self, ttl_ms: u64) -> String

The published key list (SPEC-SERVER §7.2): version 1, the active key unbounded, each retired key bounded by notAfterMs (retired_at_ms + ttl_ms). Mounting it at /.well-known/mkit-url-token-keys.json is WP-4.16.

Trait Implementations§

Source§

impl Debug for UrlTokenKeys

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Key ids only; never a seed.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSend for T
where T: Send + ?Sized,

Source§

impl<T> MaybeSync for T
where T: Sync + ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more