-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
Implement utilities for AgentCard signatures.
Signatures are described in the spec and this Python PR can serve as a reference.
- Create a new package
a2acrypto. - Make it export a verfifier.
type KeyResolver interface {
ResolveKey(kid, jku string) (crypto.PublicKey, error)
}
type VerifierConfig struct {
KeyResolver KeyResolver
}
func NewVerifier(config VerifierConfig) *Verifier { ... }
func (v *Verifier) Verify(card *a2a.AgentCard, signature *a2a.AgentCardSignature) error { ... }- Make it export a signer.
type SignerConfig struct {
PrivateKey crypto.Signer
KeyID string
Algorithm string
JWKSURL string
}
func NewSigner(config SignerConfig) *Signer { ... }
func (s *Signer) Sign(card *a2a.AgentCard) (*a2a.AgentCardSignature, error) { ... }- Make
a2aclient.Clientbe configurable witha2aclient.WithCardVerifier(*a2acrypto.Verifier). If set, the verifier should run whenGetAgentCard()is called. - Make
agentcard.Resolverhave an*a2acrypto.Verifierfield. If set, the verifier should be used inResolve(). - Use the signer to implement an
a2asrv.NewSignedCardProducerfor wrapping a user-provided AgentCardProducer.
type signedAgentCardProducer struct {
wrapped AgentCardProducer
signer *a2asrv.Signer
}
func (p *signedAgentCardProducer) Card(ctx context.Context) (*a2a.AgentCard, error) { ... }
func NewSignedCardProducer(*a2acrypto.Signer, AgentCardProducer) AgentCardProducer { ... }Add tests to verify the implementation. Can use Python or other SDK to generate an expected signature to compare against.
Metadata
Metadata
Assignees
Labels
No labels