pub struct KeyAttestation {
pub attestation_version: String,
pub controller: String,
pub identity: WorkloadIdentity,
pub org_wide: bool,
pub key_id: String,
pub algorithm: String,
pub public_key_jwk: Jwk,
pub key_fingerprint: String,
pub not_before: DateTime<Utc>,
pub not_after: DateTime<Utc>,
pub token_hash: String,
}Expand description
The acdp-key-attestation/1 metadata of an acdp:key-attestation
body (§5.3). Closed at every level; build it with
KeyAttestation::from_metadata or KeyAttestation::from_body,
which also check the rules the schema cannot express.
Fields§
§attestation_version: StringAlways ATTESTATION_VERSION.
controller: StringThe controller’s did:web DID.
identity: WorkloadIdentityThe verified workload identity.
org_wide: boolCopied from the controller’s DID-document entry.
key_id: String<controller>#acdp-kl-<hex> (§6.1).
algorithm: Stringed25519 or ecdsa-p256.
public_key_jwk: JwkThe attested key.
key_fingerprint: StringThe attested key’s RFC-ACDP-0010 §6 fingerprint.
not_before: DateTime<Utc>Start of the window, inclusive.
not_after: DateTime<Utc>End of the window, exclusive.
token_hash: Stringsha256: + hex SHA-256 of the token.
Implementations§
Source§impl KeyAttestation
impl KeyAttestation
Sourcepub fn from_metadata(metadata: &Value) -> Result<Self, AcdpError>
pub fn from_metadata(metadata: &Value) -> Result<Self, AcdpError>
Parse the metadata object and check §5.3: the closed schema, the
fingerprint of public_key_jwk, the key_id derived from it, the
algorithm matching the key type, and the window bound.
Sourcepub fn from_body(body: &Body) -> Result<Self, AcdpError>
pub fn from_body(body: &Body) -> Result<Self, AcdpError>
Check an attestation body against §5.3 and return its metadata:
the body shape (type, public, version 1, no lineage or links),
agent_id equal to did:web: plus the ctx_id authority, the
schema_uri, acdp_version ≥ 0.5.0 and the metadata rules.
The body’s own hash, signature and receipt are the caller’s to verify (§8.1 step 1).
Sourcepub fn binds(&self, agent_id: &AgentDid, signature: &Signature) -> bool
pub fn binds(&self, agent_id: &AgentDid, signature: &Signature) -> bool
§6.2 / §8.1 step 3: agent_id, signature.key_id and
signature.algorithm match this attestation.
Sourcepub fn window_contains(&self, t: DateTime<Utc>) -> bool
pub fn window_contains(&self, t: DateTime<Utc>) -> bool
True when t lies in [not_before, not_after).
Sourcepub fn signer(&self) -> KeylessSigner
pub fn signer(&self) -> KeylessSigner
The signer this attestation makes of a body (§7).
Trait Implementations§
Source§impl Clone for KeyAttestation
impl Clone for KeyAttestation
Source§impl Debug for KeyAttestation
impl Debug for KeyAttestation
Source§impl<'de> Deserialize<'de> for KeyAttestation
impl<'de> Deserialize<'de> for KeyAttestation
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>,
impl Eq for KeyAttestation
Source§impl PartialEq for KeyAttestation
impl PartialEq for KeyAttestation
Source§impl Serialize for KeyAttestation
impl Serialize for KeyAttestation
impl StructuralPartialEq for KeyAttestation
Auto Trait Implementations§
impl Freeze for KeyAttestation
impl RefUnwindSafe for KeyAttestation
impl Send for KeyAttestation
impl Sync for KeyAttestation
impl Unpin for KeyAttestation
impl UnsafeUnpin for KeyAttestation
impl UnwindSafe for KeyAttestation
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.