#[non_exhaustive]pub enum CoreJwsSigningAlgorithm {
Show 13 variants
HmacSha256,
HmacSha384,
HmacSha512,
RsaSsaPkcs1V15Sha256,
RsaSsaPkcs1V15Sha384,
RsaSsaPkcs1V15Sha512,
EcdsaP256Sha256,
EcdsaP384Sha384,
EcdsaP521Sha512,
RsaSsaPssSha256,
RsaSsaPssSha384,
RsaSsaPssSha512,
None,
}Expand description
OpenID Connect Core JWS signing algorithms.
These algorithms represent the alg header parameter values for JSON Web Signature.
They are used to digitally sign or create a MAC of the contents of the JWS Protected Header and
the JWS Payload. The values are described in
Section 3.1 of RFC 7518.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
HmacSha256
HMAC using SHA-256 (currently unsupported).
HmacSha384
HMAC using SHA-384 (currently unsupported).
HmacSha512
HMAC using SHA-512 (currently unsupported).
RsaSsaPkcs1V15Sha256
RSA SSA PKCS#1 v1.5 using SHA-256.
RsaSsaPkcs1V15Sha384
RSA SSA PKCS#1 v1.5 using SHA-384.
RsaSsaPkcs1V15Sha512
RSA SSA PKCS#1 v1.5 using SHA-512.
EcdsaP256Sha256
ECDSA using P-256 and SHA-256 (currently unsupported).
EcdsaP384Sha384
ECDSA using P-384 and SHA-384 (currently unsupported).
EcdsaP521Sha512
ECDSA using P-521 and SHA-512 (currently unsupported).
RsaSsaPssSha256
RSA SSA-PSS using SHA-256 and MGF1 with SHA-256.
RsaSsaPssSha384
RSA SSA-PSS using SHA-384 and MGF1 with SHA-384.
RsaSsaPssSha512
RSA SSA-PSS using SHA-512 and MGF1 with SHA-512.
None
No digital signature or MAC performed.
§Security Warning
This algorithm provides no security over the integrity of the JSON Web Token. Clients should be careful not to rely on unsigned JWT’s for security purposes. See Critical vulnerabilities in JSON Web Token libraries for further discussion.
Trait Implementations§
Source§impl Clone for CoreJwsSigningAlgorithm
impl Clone for CoreJwsSigningAlgorithm
Source§fn clone(&self) -> CoreJwsSigningAlgorithm
fn clone(&self) -> CoreJwsSigningAlgorithm
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CoreJwsSigningAlgorithm
impl Debug for CoreJwsSigningAlgorithm
Source§impl<'de> Deserialize<'de> for CoreJwsSigningAlgorithm
impl<'de> Deserialize<'de> for CoreJwsSigningAlgorithm
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>,
impl Eq for CoreJwsSigningAlgorithm
Source§impl Hash for CoreJwsSigningAlgorithm
impl Hash for CoreJwsSigningAlgorithm
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>
None if no key ID is specified.Source§fn key_type(&self) -> &CoreJsonWebKeyType
fn key_type(&self) -> &CoreJsonWebKeyType
Source§fn key_use(&self) -> Option<&CoreJsonWebKeyUse>
fn key_use(&self) -> Option<&CoreJsonWebKeyUse>
None if no usage is
specified.Source§fn new_symmetric(key: Vec<u8>) -> Self
fn new_symmetric(key: Vec<u8>) -> Self
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>
signature using the given signature algorithm (signature_alg) over
the given message. 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>
None if this
algorithm does not require a key.Source§fn hash_bytes(&self, bytes: &[u8]) -> Result<Vec<u8>, String>
fn hash_bytes(&self, bytes: &[u8]) -> Result<Vec<u8>, String>
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
Source§impl PartialEq for CoreJwsSigningAlgorithm
impl PartialEq for CoreJwsSigningAlgorithm
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>
message using the given signature algorithm.Source§fn as_verification_key(&self) -> CoreJsonWebKey
fn as_verification_key(&self) -> CoreJsonWebKey
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>
message using the given signature algorithm.Source§fn as_verification_key(&self) -> CoreJsonWebKey
fn as_verification_key(&self) -> CoreJsonWebKey
Source§impl Serialize for CoreJwsSigningAlgorithm
impl Serialize for CoreJwsSigningAlgorithm
impl StructuralPartialEq for CoreJwsSigningAlgorithm
Auto Trait Implementations§
impl Freeze for CoreJwsSigningAlgorithm
impl RefUnwindSafe for CoreJwsSigningAlgorithm
impl Send for CoreJwsSigningAlgorithm
impl Sync for CoreJwsSigningAlgorithm
impl Unpin for CoreJwsSigningAlgorithm
impl UnsafeUnpin for CoreJwsSigningAlgorithm
impl UnwindSafe for CoreJwsSigningAlgorithm
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
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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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