pub struct CertExtensions { /* private fields */ }wire only.Expand description
Typed extension fields committed into a DelegationCert signature.
Extensions augment the minimal cert payload with business-level metadata
without breaking the cryptographic invariants of the core fields.
The extension map is canonically serialized and hashed before inclusion in
signable_bytes, so a tampered extension causes signature verification to fail.
§Reserved namespaces
dyolo.* is reserved for protocol extensions. Applications should use
their own reverse-DNS prefix, e.g. acme.cost_center.
§Well-known keys
| Key | Type | Meaning |
|---|---|---|
dyolo.rate_limit_rpm | u64 | Max requests per minute for the delegate |
dyolo.quota_tokens | u64 | Max LLM tokens the delegate may consume |
dyolo.geo_allow | [String] | ISO-3166-1 alpha-2 country codes allowed |
dyolo.cost_center | String | Billing cost-center tag for audit |
dyolo.ttl_warn_sec | u64 | Alert threshold before expiry |
Implementations§
Source§impl CertExtensions
impl CertExtensions
Sourcepub fn set(self, key: impl Into<String>, value: impl Into<ExtValue>) -> Self
pub fn set(self, key: impl Into<String>, value: impl Into<ExtValue>) -> Self
Set an extension field. Returns self for chaining.
Panics if the size limit is exceeded. Prefer set_checked for safety.
Sourcepub fn set_checked(
self,
key: impl Into<String>,
value: impl Into<ExtValue>,
) -> Result<Self, A1Error>
pub fn set_checked( self, key: impl Into<String>, value: impl Into<ExtValue>, ) -> Result<Self, A1Error>
Set an extension field with size validation.
Keys must be non-empty. Use a reverse-DNS prefix for application-specific
keys (e.g. acme.cost_center). The dyolo.* namespace is reserved for
well-known protocol keys (dyolo.rate_limit_rpm, dyolo.quota_tokens,
dyolo.geo_allow, dyolo.cost_center, dyolo.ttl_warn_sec).
pub fn iter(&self) -> impl Iterator<Item = (&String, &ExtValue)>
Sourcepub fn commitment(&self) -> [u8; 32]
pub fn commitment(&self) -> [u8; 32]
A deterministic 32-byte commitment over all extension fields.
Trait Implementations§
Source§impl Clone for CertExtensions
impl Clone for CertExtensions
Source§fn clone(&self) -> CertExtensions
fn clone(&self) -> CertExtensions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more