Package com.tnsai.identity
Record Class Attestation
java.lang.Object
java.lang.Record
com.tnsai.identity.Attestation
- Record Components:
kind- format identifier; lowercase ASCII, hyphen-separatedvalue- opaque payload; format depends onkindissuer- principal that signed / issued this attestationissuedAt- when the issuer minted this attestationnotAfter- optional expiry; empty for non-expiring attestations
public record Attestation(String kind, String value, String issuer, Instant issuedAt, Optional<Instant> notAfter)
extends Record
Cryptographic / external-system proof that an
AgentPrincipal was issued by a trusted third party (TNS-298).
Attestation backends vary widely:
- ERC-8004 — Ethereum on-chain attestation;
kind="erc-8004",value= transaction hash,issuer= contract address. - X.509 cert — signed certificate;
kind="x509",value= base64 of the cert,issuer= CN of the issuer. - AIUC-1 audit binding — insurance certificate id;
kind="aiuc-1",value= certificate id. - JWT — bearer token issued by an OIDC provider;
kind="jwt",value= the token string.
The framework treats value as opaque — it's the verifier's
job (an AgentPrincipalProvider typically) to validate the
attestation against its underlying trust root. The framework just
carries it through audit records so external auditors can re-verify.
- Since:
- 0.10.0 (TNS-298)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanissuedAt()Returns the value of theissuedAtrecord component.issuer()Returns the value of theissuerrecord component.kind()Returns the value of thekindrecord component.notAfter()Returns the value of thenotAfterrecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
Method Details
-
isExpired
- Returns:
truewhennotAfteris set and falls beforenow; auditors and verifiers should reject expired attestations.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
issuer
Returns the value of theissuerrecord component.- Returns:
- the value of the
issuerrecord component
-
issuedAt
Returns the value of theissuedAtrecord component.- Returns:
- the value of the
issuedAtrecord component
-
notAfter
Returns the value of thenotAfterrecord component.- Returns:
- the value of the
notAfterrecord component
-