Skip to main content

SignatureAlgorithm

Enum SignatureAlgorithm 

Source
pub enum SignatureAlgorithm {
    Es256,
    Rs256,
    EdDsa,
}
Expand description

The algorithms this package will verify.

Variants§

§

Es256

COSE -7. ECDSA on P-256 with SHA-256, and what essentially every passkey in the world uses: Apple, Google, Yubico, the password managers.

§

Rs256

COSE -257. RSASSA-PKCS1-v1_5 with SHA-256. Not what a modern passkey uses, and not optional either: TPM-backed Windows Hello credentials and a number of older security keys sign with nothing else, and a relying party that does not offer it turns those authenticators away at registration.

§

EdDsa

COSE -8. Ed25519, which some security keys prefer.

Implementations§

Source§

impl SignatureAlgorithm

Source

pub fn cose_id(self) -> i64

The number as it appears in a COSE key and in pubKeyCredParams.

Source

pub fn from_cose_id(id: i64) -> Option<SignatureAlgorithm>

Source

pub fn offered() -> [SignatureAlgorithm; 3]

What a relying party offers during registration, best first.

ES256 leads because essentially every passkey in the world uses it. RS256 is second because browsers warn when it is missing and because the authenticators that need it can do nothing else. Everything listed here can be verified by CoseKey::verify; offering an algorithm this package cannot check would mean a ceremony that succeeds in the browser and fails on the way back.

Trait Implementations§

Source§

impl Clone for SignatureAlgorithm

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SignatureAlgorithm

Source§

impl Debug for SignatureAlgorithm

Source§

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

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

impl Eq for SignatureAlgorithm

Source§

impl PartialEq for SignatureAlgorithm

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SignatureAlgorithm

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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.