pub struct CertChain {
pub agent_pubkey: [u8; 32],
pub metadata: AgentMetadata,
pub issuer: Issuer,
pub issuer_sig: SerdeSig,
}Expand description
The proof that this agent serves a specific user — directly (root) or through a chain of attenuating delegations.
Fields§
§agent_pubkey: [u8; 32]§metadata: AgentMetadata§issuer: IssuerWho signed this cert: the root user, or a parent agent + its cert.
issuer_sig: SerdeSigThe issuer’s signature over (agent_pubkey || metadata_bytes).
Implementations§
Source§impl CertChain
impl CertChain
Sourcepub fn verify(&self) -> Result<()>
pub fn verify(&self) -> Result<()>
Verify the cert chain end to end.
- Root (
Issuer::User): the user’s key must have signed(agent_pubkey || metadata_bytes). - Delegated (
Issuer::Agent): the named parent pubkey must match the embedded parent cert, that parent cert must itself verify (rooting at a user), the parent agent’s key must have signed this cert, and this cert’s caveats must be⊑the parent’s (MeshError::CaveatAmplificationotherwise). Attenuation is thus enforced structurally at every link — a forged or tampered chain that amplifies authority is rejected even if each signature is valid.
Sourcepub fn agent_fingerprint(&self) -> Fingerprint
pub fn agent_fingerprint(&self) -> Fingerprint
Fingerprint of the agent’s public key.
Sourcepub fn user_fingerprint(&self) -> Fingerprint
pub fn user_fingerprint(&self) -> Fingerprint
Fingerprint of the root user this cert chains up to (walking through any delegations). Unchanged for root certs.
Sourcepub fn root_user_pubkey(&self) -> UserPublic
pub fn root_user_pubkey(&self) -> UserPublic
The root user’s public key this cert chains up to.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CertChain
impl<'de> Deserialize<'de> for CertChain
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CertChain
impl StructuralPartialEq for CertChain
Auto Trait Implementations§
impl Freeze for CertChain
impl RefUnwindSafe for CertChain
impl Send for CertChain
impl Sync for CertChain
impl Unpin for CertChain
impl UnsafeUnpin for CertChain
impl UnwindSafe for CertChain
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
Mutably borrows from an owned value. Read more