Available on crate feature
signing only.Expand description
Agent card signing and verification (spec §8.4).
Provides RFC 8785 JSON canonicalization and JWS compact serialization
with detached payload for signing AgentCard
documents.
This module is only available when the signing feature is enabled.
§Algorithm support
ES256 (ECDSA with P-256 and SHA-256) and EdDSA (Ed25519, RFC 8037), both
through ring. Keys are accepted raw, as SubjectPublicKeyInfo DER, or
as a JWK from a JWK Set (Jwks), selected by the signature’s kid.
Structs§
- Jwk
- One key of a JWK Set, as RFC 7517 writes it; only the members needed to select and use a public key are read.
- Jwks
- A JWK Set: what a
jkuURL serves. - Signature
Header - The decoded JWS protected header of an
AgentCardSignature.
Enums§
- Verifying
Key - A public key and the one algorithm it may verify.
Functions§
- canonicalize
- Produces an RFC 8785 (JCS) canonical JSON serialization of a value.
- canonicalize_
card - Canonicalizes an
AgentCardto bytes for signing. - canonicalize_
card_ json canonicalize_cardfor a card as received: the JSON object a peer served, with every field it holds, including ones this SDK does not model.- sign_
card_ ed25519 - Signs an
AgentCardwith Ed25519 (JWSEdDSA, RFC 8037), assign_card_es256does for ES256. - sign_
card_ ed25519_ with_ jku sign_card_ed25519, withjkuin the protected header, assign_card_es256_with_jku.- sign_
card_ es256 - Signs an
AgentCardwith ES256 (ECDSA P-256 + SHA-256), JWS compact serialization with a detached payload (spec §8.4). - sign_
card_ es256_ with_ jku sign_card_es256, with the JWK Set URL a verifier can fetch the key from in the protected header (spec §8.4.2: the protected header MAY includejku).- signature_
header - Decodes the JWS protected header of an
AgentCardSignature. - verify_
agent_ card - Verifies an
AgentCardSignatureagainst anAgentCardusing the given public key. - verify_
agent_ card_ with_ jwks - Verifies an
AgentCardSignatureagainst the keys of a JWK Set: those with the signature’skid(every key, when it names none) whose type is for itsalg. Succeeds when one of them verifies. - verify_
card_ json_ with_ jwks verify_card_with_jwksfor a card as received: the JSON object a peer served, verified before it is read into anAgentCard.- verify_
card_ with_ jwks - Verifies a card against a JWK Set.