web_authn_lite v0.1.0 WebAuthnLite.Operation.Register

Functions for Registering a new credential operation

https://www.w3.org/TR/webauthn/#registering-a-new-credential

Link to this section Summary

Functions

Verify attestation object and return public key

Verify clientDataJSON and return struct

Link to this section Functions

Link to this function validate_attestation_object(map)
validate_attestation_object(params :: map()) ::
  {:ok, attestation_object :: WebAuthnLite.AttestationObject.t()}
  | {:error, term()}

Verify attestation object and return public key.

NOTE: This function doesn’t verify attestation statement yet.

iex> {:ok, attestation_object} = WebAuthnLite.Operation.Register.validate_attestation_object(%{attestation_object: encoded_attestation_object, client_data_json: encoded_client_data_json})

Link to this function validate_client_data_json(map)
validate_client_data_json(params :: map()) ::
  {:ok, client_data_json :: WebAuthnLite.ClientDataJSON.t()} | {:error, term()}

Verify clientDataJSON and return struct.

iex> {:ok, client_data_json} = WebAuthnLite.Operation.Register.validate_client_data_json(%{client_data_json: encoded_client_data_json, origin: origin, challenge: challenge})