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.

See Also:
  • 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

      public static AgentCardSignature.Builder builder()
      Create a new Builder
      Returns:
      the builder
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • header

      public @Nullable Map<String,Object> header()
      Returns the value of the header record component.
      Returns:
      the value of the header record component
    • protectedHeader

      @SerializedName("protected") public String protectedHeader()
      Returns the value of the protectedHeader record component.
      Returns:
      the value of the protectedHeader record component
    • signature

      public String signature()
      Returns the value of the signature record component.
      Returns:
      the value of the signature record component