#[non_exhaustive]pub enum Algorithm {
EdDsa,
Es256,
}Expand description
A JOSE signature algorithm this workspace can produce and verify.
Both are asymmetric and, crucially, both are deterministic: Ed25519 by
construction (RFC 8032) and ECDSA P-256 through the RFC 6979 nonce the
ecdsa crate derives from the key and message. That is what lets a
conformance vector record signature bytes at all.
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.
EdDsa
EdDSA over Ed25519 (RFC 8037).
Es256
ES256: ECDSA using P-256 and SHA-256 (RFC 7518 Section 3.4).
Implementations§
Source§impl Algorithm
impl Algorithm
Sourcepub fn parse(alg: &str) -> Result<Algorithm, JoseError>
pub fn parse(alg: &str) -> Result<Algorithm, JoseError>
Parses a JOSE alg value.
§Errors
Returns JoseError::ForbiddenAlg for none, a symmetric algorithm or
an encryption algorithm — the families a proof of possession may never
use — and JoseError::UnsupportedAlg for anything else this crate
cannot produce.
Trait Implementations§
impl Copy for Algorithm
impl Eq for Algorithm
impl StructuralPartialEq for Algorithm
Auto Trait Implementations§
impl Freeze for Algorithm
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin for Algorithm
impl UnsafeUnpin for Algorithm
impl UnwindSafe for Algorithm
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