Package org.a2aproject.sdk.spec
Record Class AgentCardSignature
java.lang.Object
java.lang.Record
org.a2aproject.sdk.spec.AgentCardSignature
- Record Components:
header- optional unprotected header with additional metadata (optional)protectedHeader- Base64URL-encoded protected header containing algorithm and key info (required)signature- the Base64URL-encoded signature value (required)
public record AgentCardSignature(@Nullable Map<String,Object> header, String protectedHeader, String signature)
extends Record
Represents a digital signature for an
AgentCard using JSON Web Signature (JWS) format.
AgentCardSignature provides cryptographic proof that an AgentCard was issued by a trusted authority and has not been tampered with. This enables verification of agent authenticity and integrity in security-sensitive scenarios.
The signature follows RFC 7515 JSON Web Signature (JWS) specification, consisting of:
- A protected header (Base64URL-encoded JSON) containing algorithm and key information
- An optional unprotected header with additional metadata
- The signature value itself
Multiple signatures can be included in an AgentCard to support different verification authorities or key algorithms.
This class is immutable. Use the AgentCardSignature.Builder for construction.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructing immutableAgentCardSignatureinstances. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AgentCardSignature.Builderbuilder()Create a new Builderfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.header()Returns the value of theheaderrecord component.Returns the value of theprotectedHeaderrecord component.Returns the value of thesignaturerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AgentCardSignature
public AgentCardSignature(@Nullable Map<String, Object> header, String protectedHeader, String signature) Compact constructor that validates required fields.- Parameters:
header- the header parameter (see class-level JavaDoc)protectedHeader- the protectedHeader parameter (see class-level JavaDoc)signature- the signature parameter (see class-level JavaDoc)- Throws:
IllegalArgumentException- if protectedHeader or signature is null
-
-
Method Details
-
builder
Create a new Builder- Returns:
- the builder
-
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). -
header
Returns the value of theheaderrecord component.- Returns:
- the value of the
headerrecord component
-
protectedHeader
Returns the value of theprotectedHeaderrecord component.- Returns:
- the value of the
protectedHeaderrecord component
-
signature
Returns the value of thesignaturerecord component.- Returns:
- the value of the
signaturerecord component
-