pub struct CapsuleBody {
pub version: String,
pub subject_keys: Vec<HybridKeyPair>,
pub next_key_commitments: Vec<[u8; 64]>,
pub services: Vec<ServiceEntry>,
pub label_hints: Option<Vec<String>>,
pub also_known_as: Option<Vec<String>>,
pub delegations: Option<Vec<Delegation>>,
pub witnesses: Option<Vec<String>>,
}Fields§
§version: String§subject_keys: Vec<HybridKeyPair>§next_key_commitments: Vec<[u8; 64]>§services: Vec<ServiceEntry>§label_hints: Option<Vec<String>>§also_known_as: Option<Vec<String>>Classical DID aliases this did:at9p identity attests to — the
hybrid-signed leg of the alsoKnownAs aliasing bridge (#896 / D4,
design #879 Q4 / #905 §2/§6). Each entry is a did:web / did:key /
did:plc identifier the capsule claims to also be. Because the list
lives inside the GATE-verified capsule body, it is content-bound to the
at9p identity and signed under pinned Hybrid — the strongest of the two
aliasing legs. The reciprocal (classical→at9p) vouch is classical-only
(a DID document’s best), so the authoritative-direction rule
(at9p_alias::resolve_authoritative_alias) requires both legs to
name each other before the at9p identity is trusted.
delegations: Option<Vec<Delegation>>§witnesses: Option<Vec<String>>Implementations§
Source§impl CapsuleBody
impl CapsuleBody
pub fn new( subject_keys: Vec<HybridKeyPair>, services: Vec<ServiceEntry>, ) -> Result<Self>
Sourcepub fn subject_key_for_ed25519(
&self,
ed25519_pub: &[u8],
) -> Option<&HybridKeyPair>
pub fn subject_key_for_ed25519( &self, ed25519_pub: &[u8], ) -> Option<&HybridKeyPair>
Select the published subject key whose Ed25519 half equals ed25519_pub,
if any — the set-semantics accessor (#1188 / #1183).
subjectKeys is a set of currently-usable identity keys, not an ordered
list with a positional “primary”. A consumer that holds an Ed25519
application-signer key (admission #894, native announcements #1004) finds
its hybrid pair by identity, and takes the atomically-bound ML-DSA-65
half from the same entry. The schema guarantees at most one match
([validate_unique_subject_keys] forbids a repeated Ed25519 half), so
this is unambiguous. Returns None when no published key matches — the
caller then rejects fail-closed, never falling back to a positional key.
Sourcepub fn publishes_ed25519(&self, ed25519_pub: &[u8]) -> bool
pub fn publishes_ed25519(&self, ed25519_pub: &[u8]) -> bool
Whether ed25519_pub is one of the published subject keys.
Sourcepub fn to_dag_cbor(&self) -> Result<Vec<u8>>
pub fn to_dag_cbor(&self) -> Result<Vec<u8>>
Canonical DAG-CBOR bytes of the capsule body.
This is the signed payload for an at9p capsule: the composite signature
(see crate::at9p_sign) covers exactly these bytes, never the
enclosing signatures field. Validates the body first so a record whose
pub fields were mutated after construction cannot emit (or get signed
over) bytes the decode side would reject.
pub fn validate(&self) -> Result<()>
Trait Implementations§
Source§impl Clone for CapsuleBody
impl Clone for CapsuleBody
Source§fn clone(&self) -> CapsuleBody
fn clone(&self) -> CapsuleBody
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 CapsuleBody
impl Debug for CapsuleBody
Source§impl PartialEq for CapsuleBody
impl PartialEq for CapsuleBody
Source§fn eq(&self, other: &CapsuleBody) -> bool
fn eq(&self, other: &CapsuleBody) -> bool
self and other values to be equal, and is used by ==.impl Eq for CapsuleBody
impl StructuralPartialEq for CapsuleBody
Auto Trait Implementations§
impl Freeze for CapsuleBody
impl RefUnwindSafe for CapsuleBody
impl Send for CapsuleBody
impl Sync for CapsuleBody
impl Unpin for CapsuleBody
impl UnsafeUnpin for CapsuleBody
impl UnwindSafe for CapsuleBody
Blanket Implementations§
Source§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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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