pub struct CapabilityManager { /* private fields */ }Expand description
Trusted grant management, separate from caller authorization at a wire boundary.
The manager owns one kernel and its process-local seal key. It does not expose raw insertion, mutable kernel access, or private bootstrap anchors as grants.
Implementations§
Source§impl CapabilityManager
impl CapabilityManager
Sourcepub fn with_key(key: [u8; 32]) -> Result<Self, KernelError>
pub fn with_key(key: [u8; 32]) -> Result<Self, KernelError>
Construct with caller-supplied random key bytes; an all-zero key is refused.
The caller must obtain these bytes from a cryptographically suitable source. It does not generate the seal key and cannot establish the supplied key’s entropy.
pub fn register_actor( &mut self, plugin_id: PluginId, level: SecurityLevel, ) -> Result<(), KernelError>
Sourcepub fn mint(
&mut self,
plugin_id: PluginId,
namespace: &str,
rights: Rights,
) -> Result<CapId, KernelError>
pub fn mint( &mut self, plugin_id: PluginId, namespace: &str, rights: Rights, ) -> Result<CapId, KernelError>
Mint a sealed grant with exactly the requested nonempty rights.
A private, unsealed anchor supplies this mint’s namespace and rights. Only the kernel-delegated, sealed child is returned. This is a library operation, not a boot hook or an authorization decision for an untrusted caller.
Sourcepub fn bootstrap_root_capability(
&mut self,
plugin_id: PluginId,
namespace: &str,
rights: Rights,
) -> Result<CapId, KernelError>
pub fn bootstrap_root_capability( &mut self, plugin_id: PluginId, namespace: &str, rights: Rights, ) -> Result<CapId, KernelError>
Compatibility name for Self::mint; the returned grant is now sealed.
Its parent is a private anchor, not another publicly usable grant.
Sourcepub fn compose(
&mut self,
parent_cap_id: CapId,
target_plugin: PluginId,
requested_rights: Rights,
) -> Result<CapId, KernelError>
pub fn compose( &mut self, parent_cap_id: CapId, target_plugin: PluginId, requested_rights: Rights, ) -> Result<CapId, KernelError>
Delegate from a current held grant; the kernel performs rights intersection.
Management callers are trusted. This does not add a separate Delegate-bit policy or authorize a wire caller to act on another actor’s grant.
Sourcepub fn get_cap(&self, cap_id: CapId) -> Option<&Capability>
pub fn get_cap(&self, cap_id: CapId) -> Option<&Capability>
Read a canonical grant, including a revoked grant; private anchors are hidden.
Sourcepub fn verify_seal(&self, cap: &Capability) -> bool
pub fn verify_seal(&self, cap: &Capability) -> bool
Verify only the signed payload under this manager’s process-local key.
The kernel seal covers holder, target, rights, parent and epoch. It does not cover the capability ID or mutable revocation flag. This predicate alone does not establish table membership, a holder’s authority or liveness.
Sourcepub fn is_live(&self, cap_id: CapId) -> bool
pub fn is_live(&self, cap_id: CapId) -> bool
Check the stored grant and every ancestor, ending at a known private anchor.
This checks current liveness. Use Self::validate for holder, seal,
namespace and right checks together. A later protected write still needs
its own synchronization with revocation; this predicate is not a transaction.