pub struct Jwks { /* private fields */ }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, or entries explicitly marked
"use":"enc", are skipped so an encryption key is never used to verify
a signature.
§Errors
Returns an A2aError when the document is not valid JSON or a loaded
key’s parameters are malformed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze 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§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request