pub struct SignedChain {
pub version: u8,
pub principal_pk: String,
pub principal_scope: String,
pub certs: Vec<DelegationCert>,
}wire only.Expand description
A portable, serializable representation of a DyoloChain.
All ed25519-dalek types are encoded as hex strings so the wire format is
language-agnostic. Any service that can deserialize JSON and call the
a1 library (or a compatible implementation) can verify the chain.
The format is intentionally minimal: principal_pk, principal_scope, and
certs. The chain fingerprint is recomputed on deserialization.
§Interoperability
Non-Rust services can verify a SignedChain by:
- Deserializing the JSON into native types.
- Re-running the Ed25519 batch verification over the cert chain.
- Re-checking scope narrowing and temporal constraints.
A formal JSON Schema is published at https://docs.rs/a1/latest/a1/wire/index.html.
Fields§
§version: u8Wire format version. Currently 1.
principal_pk: StringHex-encoded 32-byte Ed25519 verifying key of the root authority.
principal_scope: StringHex-encoded 32-byte Merkle root of the principal’s intent set.
certs: Vec<DelegationCert>Ordered delegation certificates from principal to terminal agent.
Implementations§
Source§impl SignedChain
impl SignedChain
Sourcepub fn from_chain(chain: &DyoloChain) -> Self
pub fn from_chain(chain: &DyoloChain) -> Self
Serialize a DyoloChain into a portable wire document.
pub fn from_cbor(cbor: &[u8]) -> Result<Self, A1Error>
cbor only.pub fn to_cbor(&self) -> Result<Vec<u8>, A1Error>
cbor only.Sourcepub fn into_chain_with_drift(
self,
drift_tolerance_secs: u64,
) -> Result<DyoloChain, A1Error>
pub fn into_chain_with_drift( self, drift_tolerance_secs: u64, ) -> Result<DyoloChain, A1Error>
Convert this wire document back into a live DyoloChain.
The receiver must specify the clock drift tolerance for the reconstructed chain. This prevents malicious intermediaries from widening the temporal window.
pub fn into_chain(self) -> Result<DyoloChain, A1Error>
Use into_chain_with_drift instead.
Sourcepub fn to_json_pretty(&self) -> Result<String, A1Error>
pub fn to_json_pretty(&self) -> Result<String, A1Error>
Serialize to a pretty-printed JSON string (useful for audit logs).
Trait Implementations§
Source§impl Clone for SignedChain
impl Clone for SignedChain
Source§fn clone(&self) -> SignedChain
fn clone(&self) -> SignedChain
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more