pub struct Jwks { /* private fields */ }auth-jwt only.Expand description
A set of asymmetric verification keys (an RFC 7517 JWK Set).
Built from a JWKS JSON document (from_json) or key by
key (with_rsa / with_ec_p256).
HMAC (HS256) secrets are not part of a JWKS — configure those directly
on the JwtValidator with JwtValidator::with_hs256_secret.
Implementations§
Source§impl Jwks
impl Jwks
Sourcepub fn from_json(json: &[u8]) -> Result<Jwks, A2aError>
pub fn from_json(json: &[u8]) -> Result<Jwks, A2aError>
Parses a standard JWK Set JSON document
({"keys":[{"kty":"RSA",...},{"kty":"EC",...}]}).
RSA keys (fields n, e) and EC/P-256 keys (fields x, y) are
loaded; entries of any other kty/crv are skipped. So is any entry
that is not for verifying signatures (RFC 7517 4.2 and 4.3): one whose
use is present and is not sig, or whose key_ops is present and
does not list verify. A key whose alg is present verifies only
tokens whose header names that algorithm (RFC 8725 3.1); RS256 for an
RSA key and ES256 for a P-256 key are the only ones this validator
accepts, so a key declaring any other (RS512, PS256, RSA-OAEP)
verifies nothing.
§Errors
Returns an A2aError when the document is not valid JSON, a member
has the wrong type (key_ops that is not an array of strings), or a
loaded key’s parameters are malformed.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Jwks
impl Freeze for Jwks
impl Move for Jwks
impl RefUnwindSafe for Jwks
impl Send for Jwks
impl Sync for Jwks
impl Unpin for Jwks
impl UnsafeUnpin for Jwks
impl UnwindSafe for Jwks
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].