#[non_exhaustive]
pub enum CoreJsonWebKeyType { EllipticCurve, RSA, OctetKeyPair, Symmetric, }
Expand description

Type of JSON Web Key.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

EllipticCurve

Elliptic Curve Cryptography (ECC) key.

ECC algorithms such as ECDSA are currently unsupported.

§

RSA

RSA key.

§

OctetKeyPair

EdDSA key.

§

Symmetric

Symmetric key.

Trait Implementations§

source§

impl Clone for CoreJsonWebKeyType

source§

fn clone(&self) -> CoreJsonWebKeyType

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 Debug for CoreJsonWebKeyType

source§

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

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

impl<'de> Deserialize<'de> for CoreJsonWebKeyType

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 JsonWebKey<CoreJwsSigningAlgorithm, CoreJsonWebKeyType, CoreJsonWebKeyUse> for CoreJsonWebKey

source§

fn key_id(&self) -> Option<&JsonWebKeyId>

Returns the key ID, or None if no key ID is specified.
source§

fn key_type(&self) -> &CoreJsonWebKeyType

Returns the key type (e.g., RSA).
source§

fn key_use(&self) -> Option<&CoreJsonWebKeyUse>

Returns the allowed key usage (e.g., signing or encryption), or None if no usage is specified.
source§

fn new_symmetric(key: Vec<u8>) -> Self

Initializes a new symmetric key or shared signing secret from the specified raw bytes.
source§

fn verify_signature( &self, signature_alg: &CoreJwsSigningAlgorithm, message: &[u8], signature: &[u8] ) -> Result<(), SignatureVerificationError>

Verifies the given signature using the given signature algorithm (signature_alg) over the given message. Read more
source§

fn signing_alg(&self) -> JsonWebKeyAlgorithm<&CoreJwsSigningAlgorithm>

Returns the algorithm (e.g. ES512) this key must be used with, or Unspecified if no algorithm constraint was given, or unsupported if the algorithm is not for signing. Read more
source§

impl JweContentEncryptionAlgorithm<CoreJsonWebKeyType> for CoreJweContentEncryptionAlgorithm

source§

fn key_type(&self) -> Result<CoreJsonWebKeyType, String>

Returns the type of key required to use this encryption algorithm.
source§

impl JwsSigningAlgorithm<CoreJsonWebKeyType> for CoreJwsSigningAlgorithm

source§

fn key_type(&self) -> Option<CoreJsonWebKeyType>

Returns the type of key required to use this signature algorithm, or None if this algorithm does not require a key.
source§

fn uses_shared_secret(&self) -> bool

Returns true if the signature algorithm uses a shared secret (symmetric key).
source§

fn hash_bytes(&self, bytes: &[u8]) -> Result<Vec<u8>, String>

Hashes the given bytes using the hash algorithm associated with this signing algorithm, and returns the hashed bytes. Read more
source§

fn rsa_sha_256() -> Self

Returns the RS256 algorithm. Read more
source§

impl PartialEq for CoreJsonWebKeyType

source§

fn eq(&self, other: &CoreJsonWebKeyType) -> 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 PrivateSigningKey<CoreJwsSigningAlgorithm, CoreJsonWebKeyType, CoreJsonWebKeyUse, CoreJsonWebKey> for CoreEdDsaPrivateSigningKey

source§

fn sign( &self, signature_alg: &CoreJwsSigningAlgorithm, message: &[u8] ) -> Result<Vec<u8>, SigningError>

Signs the given message using the given signature algorithm.
source§

fn as_verification_key(&self) -> CoreJsonWebKey

Converts this key to a JSON Web Key that can be used for verifying signatures.
source§

impl PrivateSigningKey<CoreJwsSigningAlgorithm, CoreJsonWebKeyType, CoreJsonWebKeyUse, CoreJsonWebKey> for CoreHmacKey

source§

fn sign( &self, signature_alg: &CoreJwsSigningAlgorithm, message: &[u8] ) -> Result<Vec<u8>, SigningError>

Signs the given message using the given signature algorithm.
source§

fn as_verification_key(&self) -> CoreJsonWebKey

Converts this key to a JSON Web Key that can be used for verifying signatures.
source§

impl PrivateSigningKey<CoreJwsSigningAlgorithm, CoreJsonWebKeyType, CoreJsonWebKeyUse, CoreJsonWebKey> for CoreRsaPrivateSigningKey

source§

fn sign( &self, signature_alg: &CoreJwsSigningAlgorithm, msg: &[u8] ) -> Result<Vec<u8>, SigningError>

Signs the given message using the given signature algorithm.
source§

fn as_verification_key(&self) -> CoreJsonWebKey

Converts this key to a JSON Web Key that can be used for verifying signatures.
source§

impl Serialize for CoreJsonWebKeyType

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 Eq for CoreJsonWebKeyType

source§

impl JsonWebKeyType for CoreJsonWebKeyType

source§

impl StructuralPartialEq for CoreJsonWebKeyType

Auto Trait Implementations§

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> DynClone for T
where T: Clone,

source§

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

§

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

§

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

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

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

§

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

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