Enum openidconnect::core::CoreJsonWebKeyType
source · #[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
impl Clone for CoreJsonWebKeyType
source§fn clone(&self) -> CoreJsonWebKeyType
fn clone(&self) -> CoreJsonWebKeyType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CoreJsonWebKeyType
impl Debug for CoreJsonWebKeyType
source§impl<'de> Deserialize<'de> for CoreJsonWebKeyType
impl<'de> Deserialize<'de> for CoreJsonWebKeyType
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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
impl JsonWebKey<CoreJwsSigningAlgorithm, CoreJsonWebKeyType, CoreJsonWebKeyUse> for CoreJsonWebKey
source§fn key_id(&self) -> Option<&JsonWebKeyId>
fn key_id(&self) -> Option<&JsonWebKeyId>
Returns the key ID, or
None
if no key ID is specified.source§fn key_type(&self) -> &CoreJsonWebKeyType
fn key_type(&self) -> &CoreJsonWebKeyType
Returns the key type (e.g., RSA).
source§fn key_use(&self) -> Option<&CoreJsonWebKeyUse>
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
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>
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 moresource§fn signing_alg(&self) -> JsonWebKeyAlgorithm<&CoreJwsSigningAlgorithm>
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 moresource§impl JwsSigningAlgorithm<CoreJsonWebKeyType> for CoreJwsSigningAlgorithm
impl JwsSigningAlgorithm<CoreJsonWebKeyType> for CoreJwsSigningAlgorithm
source§fn key_type(&self) -> Option<CoreJsonWebKeyType>
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.Returns true if the signature algorithm uses a shared secret (symmetric key).
source§fn hash_bytes(&self, bytes: &[u8]) -> Result<Vec<u8>, String>
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 moresource§fn rsa_sha_256() -> Self
fn rsa_sha_256() -> Self
Returns the RS256 algorithm. Read more
source§impl PartialEq for CoreJsonWebKeyType
impl PartialEq for CoreJsonWebKeyType
source§fn eq(&self, other: &CoreJsonWebKeyType) -> bool
fn eq(&self, other: &CoreJsonWebKeyType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PrivateSigningKey<CoreJwsSigningAlgorithm, CoreJsonWebKeyType, CoreJsonWebKeyUse, CoreJsonWebKey> for CoreEdDsaPrivateSigningKey
impl PrivateSigningKey<CoreJwsSigningAlgorithm, CoreJsonWebKeyType, CoreJsonWebKeyUse, CoreJsonWebKey> for CoreEdDsaPrivateSigningKey
source§fn sign(
&self,
signature_alg: &CoreJwsSigningAlgorithm,
message: &[u8]
) -> Result<Vec<u8>, SigningError>
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
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
impl PrivateSigningKey<CoreJwsSigningAlgorithm, CoreJsonWebKeyType, CoreJsonWebKeyUse, CoreJsonWebKey> for CoreHmacKey
source§fn sign(
&self,
signature_alg: &CoreJwsSigningAlgorithm,
message: &[u8]
) -> Result<Vec<u8>, SigningError>
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
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
impl PrivateSigningKey<CoreJwsSigningAlgorithm, CoreJsonWebKeyType, CoreJsonWebKeyUse, CoreJsonWebKey> for CoreRsaPrivateSigningKey
source§fn sign(
&self,
signature_alg: &CoreJwsSigningAlgorithm,
msg: &[u8]
) -> Result<Vec<u8>, SigningError>
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
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
impl Serialize for CoreJsonWebKeyType
impl Eq for CoreJsonWebKeyType
impl JsonWebKeyType for CoreJsonWebKeyType
impl StructuralPartialEq for CoreJsonWebKeyType
Auto Trait Implementations§
impl RefUnwindSafe for CoreJsonWebKeyType
impl Send for CoreJsonWebKeyType
impl Sync for CoreJsonWebKeyType
impl Unpin for CoreJsonWebKeyType
impl UnwindSafe for CoreJsonWebKeyType
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
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key
and return true
if they are equal.