Package org.a2aproject.sdk.spec
Class AgentCardSignature.Builder
java.lang.Object
org.a2aproject.sdk.spec.AgentCardSignature.Builder
- Enclosing class:
- AgentCardSignature
Builder for constructing immutable
AgentCardSignature instances.
Example usage:
AgentCardSignature sig = AgentCardSignature.builder()
.protectedHeader("eyJhbGciOiJFUzI1NiJ9")
.signature("DtEhU3ljbEg8L38VWAfUAqOyKAM6...")
.header(Map.of("kid", "2024-01"))
.build();
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new immutableAgentCardSignaturefrom the current builder state.Sets the optional unprotected header with additional metadata.protectedHeader(String protectedHeader) Sets the Base64URL-encoded protected header.Sets the Base64URL-encoded signature value.
-
Method Details
-
header
Sets the optional unprotected header with additional metadata.- Parameters:
header- map of header parameters (optional)- Returns:
- this builder for method chaining
-
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
Sets the Base64URL-encoded signature value.- Parameters:
signature- the Base64URL-encoded signature (required)- Returns:
- this builder for method chaining
-
build
Builds a new immutableAgentCardSignaturefrom the current builder state.- Returns:
- a new AgentCardSignature instance
- Throws:
IllegalArgumentException- if protectedHeader or signature is null
-