Enum bbjwt::keystore::KeyAlgorithm
source · pub enum KeyAlgorithm {
RS256,
RS384,
RS512,
ES256,
ES384,
ES512,
EdDSA,
Other,
}
Expand description
Key algorithms.
A list of values allowed in a JOSE header is here: https://www.rfc-editor.org/rfc/rfc7518#section-3.1
Variants§
RS256
RSASSA-PKCS-v1_5 using SHA-256 hash algorithm (recommended).
RS384
RSASSA-PKCS-v1_5 using SHA-384 hash algorithm (optional).
RS512
RSASSA-PKCS-v1_5 using SHA-512 hash algorithm (optional).
ES256
ECDSA using P-256 (secp256r1) curve and SHA-256 hash algorithm (recommended).
ES384
ECDSA using P-384 curve and SHA-384 hash algorithm (optional).
ES512
ECDSA using P-521 (no typo) curve and SHA-512 hash algorithm (optional). NOT SUPPORTED since 0.3.0
EdDSA
Edwards Curve DSA
Other
Other algorithms are not supported; this include “none”, which turns off validation. This is a security issue, see here
Implementations§
source§impl KeyAlgorithm
impl KeyAlgorithm
sourcepub fn message_digest(&self) -> Option<&'static Algorithm>
pub fn message_digest(&self) -> Option<&'static Algorithm>
Return message digest for an algorithm.
Trait Implementations§
source§impl Clone for KeyAlgorithm
impl Clone for KeyAlgorithm
source§fn clone(&self) -> KeyAlgorithm
fn clone(&self) -> KeyAlgorithm
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 KeyAlgorithm
impl Debug for KeyAlgorithm
source§impl Default for KeyAlgorithm
impl Default for KeyAlgorithm
source§impl<'de> Deserialize<'de> for KeyAlgorithm
impl<'de> Deserialize<'de> for KeyAlgorithm
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 PartialEq for KeyAlgorithm
impl PartialEq for KeyAlgorithm
source§fn eq(&self, other: &KeyAlgorithm) -> bool
fn eq(&self, other: &KeyAlgorithm) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for KeyAlgorithm
impl StructuralPartialEq for KeyAlgorithm
Auto Trait Implementations§
impl RefUnwindSafe for KeyAlgorithm
impl Send for KeyAlgorithm
impl Sync for KeyAlgorithm
impl Unpin for KeyAlgorithm
impl UnwindSafe for KeyAlgorithm
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.