pub struct TenantGrantIssuer { /* private fields */ }Expand description
The operator’s issuer key material for compiling tenant grants.
Holds the Ed25519 + ML-DSA-65 signing keys the operator signs UCANs with,
plus the derived issuer DID. The operator is the unit issuer (D8-1:
credits are the unit-issuer’s liability), so every grant compiled by one
issuer carries that issuer’s DID as both the UCAN issuer and the
allocation record issuer/unit.issuer.
Construct with TenantGrantIssuer::from_keys (production: keys resolved
from the node identity store) or TenantGrantIssuer::from_node_root
(derives a purpose-separated key from the operator’s persisted root), or
TenantGrantIssuer::generate_for_test in unit tests.
Implementations§
Source§impl TenantGrantIssuer
impl TenantGrantIssuer
Sourcepub fn from_keys(ed_sk: SigningKey, pq_sk: MlDsaSigningKey) -> Result<Self>
pub fn from_keys(ed_sk: SigningKey, pq_sk: MlDsaSigningKey) -> Result<Self>
Construct from already-resolved key material.
The issuer DID is derived from ed_sk’s verifying key so the two can
never drift.
Sourcepub fn from_node_root(root: &SigningKey) -> Result<Self>
pub fn from_node_root(root: &SigningKey) -> Result<Self>
Derive a purpose-separated tenant-grant issuer from the operator’s persisted node root key.
Mirrors hyprstream_rpc::node_identity::derive_mesh_mldsa_key (HKDF
over the Ed25519 seed) but under the dedicated
TENANT_GRANT_ED25519_PURPOSE label, then re-seeds the ML-DSA-65 key
from the derived Ed25519 bytes. Key-separated from every other derived
purpose (PQUIP).
Sourcepub fn issuer_did(&self) -> &Did
pub fn issuer_did(&self) -> &Did
The issuer DID (the operator’s did:key for this grant purpose).
Sourcepub fn issuer_ed_vk(&self) -> VerifyingKey
pub fn issuer_ed_vk(&self) -> VerifyingKey
The issuer’s Ed25519 verifying key (the verifier-side anchor).
Sourcepub fn issuer_pq_vk(&self) -> MlDsaVerifyingKey
pub fn issuer_pq_vk(&self) -> MlDsaVerifyingKey
The issuer’s ML-DSA-65 verifying key (the PQ leg of the composite).
Sourcepub fn compile(
&self,
binding: &TenantBinding,
epoch: u64,
now: u64,
) -> Result<CompiledTenantGrant>
pub fn compile( &self, binding: &TenantBinding, epoch: u64, now: u64, ) -> Result<CompiledTenantGrant>
Compile a TenantBinding’s entitlement into the issuer-signed grant +
inventory allocation record (#929).
epoch is the issuance epoch (revocation = bump it + reissue); now is
unix seconds used for not_before and to sanity-check an author-supplied
expiration. The CRD’s TenantEntitlement is the authoring surface;
the returned CompiledTenantGrant is the authority that lands in the
tenant’s inventory.
Fails closed on any malformation: an absent entitlement, a tenant DID that cannot anchor an Ed25519 audience, an inverted expiry, or a signing error. It never emits a half-signed grant.
Trait Implementations§
Source§impl Clone for TenantGrantIssuer
impl Clone for TenantGrantIssuer
Source§fn clone(&self) -> TenantGrantIssuer
fn clone(&self) -> TenantGrantIssuer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TenantGrantIssuer
impl Debug for TenantGrantIssuer
Source§impl TenantGrantService for TenantGrantIssuer
impl TenantGrantService for TenantGrantIssuer
fn compile_grant( &self, binding: &TenantBinding, epoch: u64, now: u64, ) -> Result<TenantGrantArtifacts, TenantGrantServiceError>
Auto Trait Implementations§
impl Freeze for TenantGrantIssuer
impl RefUnwindSafe for TenantGrantIssuer
impl Send for TenantGrantIssuer
impl Sync for TenantGrantIssuer
impl Unpin for TenantGrantIssuer
impl UnsafeUnpin for TenantGrantIssuer
impl UnwindSafe for TenantGrantIssuer
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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