Class AgentCardSignature.Builder

java.lang.Object
org.a2aproject.sdk.spec.AgentCardSignature.Builder
Enclosing class:
AgentCardSignature

public static class AgentCardSignature.Builder extends Object
Builder for constructing immutable AgentCardSignature instances.

Example usage:


 AgentCardSignature sig = AgentCardSignature.builder()
     .protectedHeader("eyJhbGciOiJFUzI1NiJ9")
     .signature("DtEhU3ljbEg8L38VWAfUAqOyKAM6...")
     .header(Map.of("kid", "2024-01"))
     .build();
 
  • Method Details

    • header

      public AgentCardSignature.Builder header(Map<String,Object> header)
      Sets the optional unprotected header with additional metadata.
      Parameters:
      header - map of header parameters (optional)
      Returns:
      this builder for method chaining
    • protectedHeader

      public AgentCardSignature.Builder protectedHeader(String protectedHeader)
      Sets the Base64URL-encoded protected header.

      The protected header typically contains the algorithm ("alg") and may include key identification ("kid") or other parameters that need integrity protection.

      Parameters:
      protectedHeader - the Base64URL-encoded protected header (required)
      Returns:
      this builder for method chaining
    • signature

      public AgentCardSignature.Builder signature(String signature)
      Sets the Base64URL-encoded signature value.
      Parameters:
      signature - the Base64URL-encoded signature (required)
      Returns:
      this builder for method chaining
    • build

      public AgentCardSignature build()
      Builds a new immutable AgentCardSignature from the current builder state.
      Returns:
      a new AgentCardSignature instance
      Throws:
      IllegalArgumentException - if protectedHeader or signature is null