Struct mas_jose::jwk::JsonWebKey

source ·
pub struct JsonWebKey<P> { /* private fields */ }

Implementations§

source§

impl<P> JsonWebKey<P>

source

pub const fn new(parameters: P) -> Self

Create a new JsonWebKey with the given parameters.

source

pub fn try_map<M, O, E>(self, mapper: M) -> Result<JsonWebKey<O>, E>
where M: FnOnce(P) -> Result<O, E>,

Map the parameters of this JsonWebKey to a new type, with a fallible mapper, consuming the original key.

§Errors

Returns an error if the mapper returns an error.

source

pub fn map<M, O>(self, mapper: M) -> JsonWebKey<O>
where M: FnOnce(P) -> O,

Map the parameters of this JsonWebKey to a new type, consuming the original key.

source

pub fn try_cloned_map<M, O, E>(&self, mapper: M) -> Result<JsonWebKey<O>, E>
where M: FnOnce(&P) -> Result<O, E>,

Map the parameters of this JsonWebKey to a new type, with a fallible mapper, cloning the other fields.

§Errors

Returns an error if the mapper returns an error.

source

pub fn cloned_map<M, O>(&self, mapper: M) -> JsonWebKey<O>
where M: FnOnce(&P) -> O,

Map the parameters of this JsonWebKey to a new type, cloning the other fields.

source

pub fn with_use(self, value: JsonWebKeyUse) -> Self

Set the use field of this JsonWebKey.

source

pub fn with_key_ops(self, key_ops: Vec<JsonWebKeyOperation>) -> Self

Set the key_ops field of this JsonWebKey.

source

pub fn with_alg(self, alg: JsonWebSignatureAlg) -> Self

Set the alg field of this JsonWebKey.

source

pub fn with_kid(self, kid: impl Into<String>) -> Self

Set the kid field of this JsonWebKey.

source

pub const fn alg(&self) -> Option<&JsonWebSignatureAlg>

Get the kid field of this JsonWebKey, if set.

source

pub const fn params(&self) -> &P

Get the inner parameters of this JsonWebKey.

Trait Implementations§

source§

impl<P: Clone> Clone for JsonWebKey<P>

source§

fn clone(&self) -> JsonWebKey<P>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<P> Constrainable for JsonWebKey<P>
where P: ParametersInfo,

source§

fn kid(&self) -> Option<&str>

Key ID (kid) of this key
source§

fn kty(&self) -> JsonWebKeyType

Key type (kty) of this key
source§

fn algs(&self) -> &[JsonWebSignatureAlg]

List of available algorithms for this key
source§

fn alg(&self) -> Option<&JsonWebSignatureAlg>

source§

fn use_(&self) -> Option<&JsonWebKeyUse>

Usage specified for this key
source§

impl<P: Debug> Debug for JsonWebKey<P>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, P> Deserialize<'de> for JsonWebKey<P>
where P: Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<P> FromIterator<JsonWebKey<P>> for JsonWebKeySet<P>

source§

fn from_iter<T: IntoIterator<Item = JsonWebKey<P>>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl<P: JsonSchema> JsonSchema for JsonWebKey<P>

source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
source§

impl<P: PartialEq> PartialEq for JsonWebKey<P>

source§

fn eq(&self, other: &JsonWebKey<P>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<P> Serialize for JsonWebKey<P>
where P: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<JsonWebKey<JsonWebKeyPrivateParameters>> for PublicJsonWebKey

§

type Error = SymetricKeyError

The type returned in the event of a conversion error.
source§

fn try_from(value: PrivateJsonWebKey) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<P: Eq> Eq for JsonWebKey<P>

source§

impl<P> StructuralPartialEq for JsonWebKey<P>

Auto Trait Implementations§

§

impl<P> Freeze for JsonWebKey<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for JsonWebKey<P>
where P: RefUnwindSafe,

§

impl<P> Send for JsonWebKey<P>
where P: Send,

§

impl<P> Sync for JsonWebKey<P>
where P: Sync,

§

impl<P> Unpin for JsonWebKey<P>
where P: Unpin,

§

impl<P> UnwindSafe for JsonWebKey<P>
where P: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,