web_authn_lite v0.1.4 WebAuthnLite.ClientDataJSON

ClientDataJSON Parser

Link to this section Summary

Functions

decode Base64 URL encoded clientDataJSON and return struct

validate Base64 URL encoded clientDataJSON with params and return struct

Link to this section Types

Link to this type t()
t() :: %WebAuthnLite.ClientDataJSON{
  challenge: String.t(),
  hash: binary(),
  origin: String.t(),
  raw: String.t(),
  type: String.t()
}

Link to this section Functions

Link to this function decode(base64_url_encoded_client_data_json)
decode(base64_url_encoded_client_data_json :: String.t()) ::
  {:ok, t()} | {:error, :invalid_format}

decode Base64 URL encoded clientDataJSON and return struct.

Link to this function validate(base64_url_encoded_client_data_json, type, origin, challenge)
validate(
  base64_url_encoded_client_data_json :: String.t(),
  type :: String.t(),
  origin :: String.t(),
  challenge :: String.t()
) ::
  {:ok, t()}
  | {:error, :invalid_format}
  | {:error, :invalid_type}
  | {:error, :invalid_origin}
  | {:error, :invalid_challenge}

validate Base64 URL encoded clientDataJSON with params and return struct.