#[non_exhaustive]pub struct Jwk {
pub kty: String,
pub crv: Option<String>,
pub x: Option<String>,
pub y: Option<String>,
pub kid: Option<String>,
pub alg: Option<String>,
pub key_use: Option<String>,
pub exp: Option<u64>,
pub x5c: Option<Vec<String>>,
}signing only.Expand description
One key of a JWK Set, as RFC 7517 writes it; only the members needed to select and use a public key are read.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kty: StringKey type: EC or OKP.
crv: Option<String>Curve: P-256 or Ed25519.
x: Option<String>The x coordinate (EC) or the public key (OKP), base64url.
y: Option<String>The y coordinate (EC), base64url.
kid: Option<String>Key id.
alg: Option<String>The algorithm the key is for, if the set says.
key_use: Option<String>Intended use; a key marked other than sig is never used to verify.
exp: Option<u64>When the key expires, in seconds since the Unix epoch (the JWT
NumericDate of RFC 7519 §2). RFC 7517 defines no expiry; some key
sets carry this member, and a key past it is never used to verify
(spec §8.4.3: “Expired or revoked keys MUST NOT be used”).
x5c: Option<Vec<String>>The key’s X.509 certificate chain (RFC 7517 §4.7): base64 (not
base64url) DER, the certificate holding this key first. A key with a
chain is used to verify only while that first certificate is valid
(notBefore through notAfter), and only if it holds this same key;
a chain that does not parse leaves the key unused. The chain is not
validated to a trust anchor, and revocation is not checked.
Implementations§
Source§impl Jwk
impl Jwk
Sourcepub fn verifying_key(&self) -> Result<VerifyingKey, A2aError>
pub fn verifying_key(&self) -> Result<VerifyingKey, A2aError>
The public key, with the algorithm its type and curve fix.
§Errors
Returns an error for an unsupported key type or curve, a key marked
for a use other than sig, an alg that contradicts the curve, or
members of the wrong length. A private member (d) is never read.
Sourcepub fn from_verifying_key(key: &VerifyingKey, kid: Option<&str>) -> Jwk
pub fn from_verifying_key(key: &VerifyingKey, kid: Option<&str>) -> Jwk
The JWK of a raw public key, for publishing in a JWK Set.
Sourcepub const fn with_expiry(self, exp: u64) -> Jwk
pub const fn with_expiry(self, exp: u64) -> Jwk
This key, published to expire at exp (seconds since the Unix
epoch); see exp.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Jwk
impl<'de> Deserialize<'de> for Jwk
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Jwk, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Jwk, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Jwk
Source§impl Serialize for Jwk
impl Serialize for Jwk
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Jwk
Auto Trait Implementations§
impl Forget for Jwk
impl Freeze for Jwk
impl Move for Jwk
impl RefUnwindSafe for Jwk
impl Send for Jwk
impl Sync for Jwk
impl Unpin for Jwk
impl UnsafeUnpin for Jwk
impl UnwindSafe for Jwk
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§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].