This class is used to perform registration step on client side.
More...
#include <webauthn_registration.h>
This class is used to perform registration step on client side.
◆ webauthn_registration()
webauthn_registration::webauthn_registration |
( |
| ) |
|
|
inline |
◆ generate_signature()
bool webauthn_registration::generate_signature |
( |
| ) |
|
|
overridevirtual |
This method checks if a token device is available on client host.
If device is present, device expects user to perform gesture action, upon which device generates credential details, which consists of authenticator data, signature and optional x509 certificate which is passed to server.
- Return values
-
FIDO_OK(false) | successful generation of credentials. |
true | error occurred. |
Implements client_registration::registration.
◆ get_client_data_json()
std::string webauthn_registration::get_client_data_json |
( |
| ) |
|
◆ get_client_data_json_len()
size_t webauthn_registration::get_client_data_json_len |
( |
| ) |
|
◆ make_challenge_response()
bool webauthn_registration::make_challenge_response |
( |
unsigned char *& |
challenge_response | ) |
|
|
overridevirtual |
This method will extract authenticator data, signature, certificate from fido_cred_t struct, construct a buffer holding this data which will be converted to base64 format before passing to server.
Format of challenge response is: [1 byte capability] [length encoded authenticator data] [length encoded signature] [length encoded certificate] [length encoded serialized client data JSON]
- Parameters
-
[out] | challenge_response | buffer to hold challenge response |
- Return values
-
Implements client_registration::registration.
◆ parse_challenge()
bool webauthn_registration::parse_challenge |
( |
const char * |
challenge | ) |
|
|
overridevirtual |
Helper method to parse the challenge received from server during registration process.
This method extracts 1 byte capability flag, salt, user name, relying party ID and set it in fido_cred_t.
- Parameters
-
[in] | challenge | buffer holding the server challenge |
- Return values
-
Implements client_registration::registration.
◆ set_client_data()
void webauthn_registration::set_client_data |
( |
const unsigned char * |
salt, |
|
|
const char * |
rp |
|
) |
| |
|
overridevirtual |
Helper method to set client data context.
Client data format is: SHA256({ "type": "webauthn.create", "challenge": url_safe_base64("32 byte random"), "origin": authentication_webauthn_rp_id, "crossOrigin": false })
- Parameters
-
[in] | salt | buffer holding random salt |
[in] | rp | relying party name aka origin |
Implements client_registration::registration.
◆ m_client_data_json
std::string webauthn_registration::m_client_data_json |
|
private |
The documentation for this class was generated from the following files: