MySQL 8.0.40
Source Code Documentation
fido_make_cred Class Reference

A wrapper class which abstracts all access to FIDO device. More...

#include <fido_registration.h>

Public Member Functions

 fido_make_cred ()
 Construcutor to allocate memory for performing attestation (registration) More...
 
 ~fido_make_cred ()
 Standard destructor. More...
 
bool make_credentials (const char *challenge)
 This method fills in all information required to initiate registration process. More...
 
bool make_challenge_response (unsigned char *&challenge_response)
 This method will extract authenticator data, signature, certificate and rp id from fido_cred_t struct, construct a buffer holding this data which will be converted to base64 format before passing to server. More...
 

Private Member Functions

void set_rp_id (std::string rp_id)
 Method to set the relying party name or id. More...
 
void set_type (int type=COSE_ES256)
 Method to set the algorithm type. More...
 
void set_user (std::string user)
 Set method to set user name. More...
 
void set_scramble (unsigned char *, size_t)
 Set method to set 32 bit random salt. More...
 
size_t get_authdata_len ()
 Method to get length of authenticator data. More...
 
const unsigned char * get_authdata_ptr ()
 Method to get authenticator data. More...
 
size_t get_sig_len ()
 Method to get length of signature. More...
 
const unsigned char * get_sig_ptr ()
 Method to get signature data. More...
 
size_t get_x5c_len ()
 Method to get length of x509 certificate. More...
 
const unsigned char * get_x5c_ptr ()
 Method to get x509 certificate. More...
 
const char * get_rp_id ()
 Method to get rp id. More...
 
bool parse_challenge (const char *challenge)
 Helper method to parse the challenge received from server during registration process. More...
 
bool generate_signature ()
 This method checks if a token device is available on client host. More...
 

Private Attributes

fido_cred_t * m_cred
 

Detailed Description

A wrapper class which abstracts all access to FIDO device.

Constructor & Destructor Documentation

◆ fido_make_cred()

fido_make_cred::fido_make_cred ( )

Construcutor to allocate memory for performing attestation (registration)

◆ ~fido_make_cred()

fido_make_cred::~fido_make_cred ( )

Standard destructor.

Member Function Documentation

◆ generate_signature()

bool fido_make_cred::generate_signature ( )
private

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.
trueerror occurred.

◆ get_authdata_len()

size_t fido_make_cred::get_authdata_len ( )
private

Method to get length of authenticator data.

Return values
lengthof authenticator data.

◆ get_authdata_ptr()

const unsigned char * fido_make_cred::get_authdata_ptr ( )
private

Method to get authenticator data.

Return values
bufferholding authenticator data

◆ get_rp_id()

const char * fido_make_cred::get_rp_id ( )
private

Method to get rp id.

Return values
bufferholding rp id

◆ get_sig_len()

size_t fido_make_cred::get_sig_len ( )
private

Method to get length of signature.

Return values
lengthof signature

◆ get_sig_ptr()

const unsigned char * fido_make_cred::get_sig_ptr ( )
private

Method to get signature data.

Return values
bufferholding signature data

◆ get_x5c_len()

size_t fido_make_cred::get_x5c_len ( )
private

Method to get length of x509 certificate.

Return values
lengthof x509 certificate

◆ get_x5c_ptr()

const unsigned char * fido_make_cred::get_x5c_ptr ( )
private

Method to get x509 certificate.

Return values
bufferholding x509 certificate

◆ make_challenge_response()

bool fido_make_cred::make_challenge_response ( unsigned char *&  challenge_response)

This method will extract authenticator data, signature, certificate and rp id from fido_cred_t struct, construct a buffer holding this data which will be converted to base64 format before passing to server.

Parameters
[out]challenge_responsebuffer to hold challenge response
Return values
falsesuccess
truefailure

◆ make_credentials()

bool fido_make_cred::make_credentials ( const char *  challenge)

This method fills in all information required to initiate registration process.

This method parses server challenge and generates challenge response.

Parameters
[in]challengebuffer holding the server challenge
Return values
falsesuccessful generation of credentials.
trueerror occurred.

◆ parse_challenge()

bool fido_make_cred::parse_challenge ( const char *  challenge)
private

Helper method to parse the challenge received from server during registration process.

This method extracts salt, user name, relying party name and set it in fido_cred_t.

Parameters
[in]challengebuffer holding the server challenge
Return values
void

◆ set_rp_id()

void fido_make_cred::set_rp_id ( std::string  rp_id)
private

Method to set the relying party name or id.

Parameters
[in]rp_idbuffer holding relying party name

◆ set_scramble()

void fido_make_cred::set_scramble ( unsigned char *  scramble,
size_t  len 
)
private

Set method to set 32 bit random salt.

Parameters
[in]scramblebuffer holding random salt
[in]lenlength of salt

◆ set_type()

void fido_make_cred::set_type ( int  type = COSE_ES256)
private

Method to set the algorithm type.

Parameters
[in]typealgorithm type

◆ set_user()

void fido_make_cred::set_user ( std::string  user)
private

Set method to set user name.

Parameters
[in]userbuffer holding user name

Member Data Documentation

◆ m_cred

fido_cred_t* fido_make_cred::m_cred
private

The documentation for this class was generated from the following files: