Struct passkey_types::u2f::RegisterResponse

source ·
pub struct RegisterResponse {
    pub public_key: PublicKey,
    pub key_handle: Vec<u8>,
    pub attestation_certificate: Vec<u8>,
    pub signature: Vec<u8>,
}
Expand description

Register response payload

This message is output by the U2F token once it created a new keypair in response to the registration request message. Note that U2F tokens SHOULD verify user presence before returning a registration response success message (otherwise they SHOULD return a test-of-user-presence-required message - see above).

Fields§

§public_key: PublicKey

This is the (uncompressed) x,y-representation of a curve point on the P-256 NIST elliptic curve. User’s new public key

§key_handle: Vec<u8>

This a handle that allows the U2F token to identify the generated key pair. U2F tokens MAY wrap the generated private key and the application id it was generated for, and output that as the key handle.

§attestation_certificate: Vec<u8>

This is a certificate in X.509 DER format. Parsing of the X.509 certificate unambiguously establishes its ending.

§signature: Vec<u8>

This is a ECDSA signature (on P-256) over the following byte string:

  1. A byte reserved for future use [1 byte] with the value 0x00.
  2. The application parameter [32 bytes] from the registration request message.
  3. The challenge parameter [32 bytes] from the registration request message.
  4. The above key handle [variable length]. (Note that the key handle length is not included in the signature base string. This doesn’t cause confusion in the signature base string, since all other parameters in the signature base string are fixed-length.)
  5. The above user public key [65 bytes].

Implementations§

source§

impl RegisterResponse

source

pub fn encode(self) -> Vec<u8>

Encode the Response to it’s binary format for a successfull response

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> 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, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V