Skip to main content

RootRegistration

Enum RootRegistration 

Source
pub enum RootRegistration {
    Ctap(RootKey),
    WebAuthn {
        attestation_object: Vec<u8>,
        client_data_json: Vec<u8>,
    },
}
Expand description

How a security key made a root’s credential (P7-08), as a device’s key API returns it: what Self::root reads the root from.

A registration is not a proof that the key is held, and is not sent anywhere: a root proves itself by signing its identity’s genesis, or its addition (root_add_message), with an assertion. Its attestation statement is carried but never checked, whatever its fmt (none, packed, apple, …), as the raw CTAP2 form’s never was: no authenticator model is required of a root.

Variants§

§

Ctap(RootKey)

Raw CTAP2 authenticatorMakeCredential (libfido2): the credential as the transport read it. Its client data hash is the identity’s handle.

§

WebAuthn

A WebAuthn registration, as a platform API returns it (Apple’s ASAuthorizationSecurityKeyPublicKeyCredentialRegistration): the attestationObject (CBOR) and the exact clientDataJSON, whose challenge is the identity’s handle, as the CTAP2 form’s client data hash is.

Fields

§attestation_object: Vec<u8>
§client_data_json: Vec<u8>

Implementations§

Source§

impl RootRegistration

Source

pub fn root(&self, handle: &[u8; 32]) -> Result<RootKey, WebAuthnError>

The root this registration made for the identity handle.

The raw CTAP2 form’s root as given: the caller checks it (RootKey::is_valid), as it always has. The WebAuthn form, in order: bounds (MAX_ATTESTATION_OBJECT, MAX_CLIENT_DATA_JSON); clientDataJSON of type webauthn.create with challenge handle (base64url, no padding), not cross-origin; the attestationObject a CBOR map with text fmt, bytes authData and map attStmt; authData under PORTABLE_RP, with UP, UV and attested credential data (AT); a credential id of 1 to MAX_CREDENTIAL_ID bytes; an ES256 P-256 COSE key on the curve.

That the credential is resident, with user.id = handle, is asked of the key but cannot be read from a registration (a key does not report it there), so it is not checked: a key that ignored it is found out when recovery by handle finds nothing.

Trait Implementations§

Source§

impl Clone for RootRegistration

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 Debug for RootRegistration

Source§

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

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

impl Eq for RootRegistration

Source§

impl PartialEq for RootRegistration

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 RootRegistration

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.