MySQL 8.0.37
Source Code Documentation
fido_prepare_assert Class Reference

A wrapper class to access fido2 library APIs to interact with the device. More...

#include <fido_assertion.h>

Public Member Functions

 fido_prepare_assert ()
 Construcutor to allocate memory for performing assertion (authentication) More...
 
 ~fido_prepare_assert ()
 Standard destructor. More...
 
bool parse_challenge (const unsigned char *challenge)
 Helper method to parse the challenge received from server during authentication process. More...
 
bool sign_challenge ()
 Method to obtains an assertion from a FIDO device. More...
 
void get_signed_challenge (unsigned char **challenge_res, size_t &challenge_res_len)
 This method will extract authenticator data, signature from fido_assert_t struct. More...
 

Private Member Functions

void set_scramble (unsigned char *scramble, size_t len)
 Set method to set 32 bit random salt. More...
 
void set_cred_id (unsigned char *cred, size_t len)
 Set method to set credential ID. More...
 
void set_rp_id (const char *rp_id)
 Method to set the relying party name or id. More...
 
const unsigned char * get_authdata_ptr ()
 Method to get authenticator data. More...
 
size_t get_authdata_len ()
 Method to get length of authenticator data. More...
 
const unsigned char * get_signature_ptr ()
 Method to get signature. More...
 
size_t get_signature_len ()
 Method to get length of signature. More...
 

Private Attributes

fido_assert_t * m_assert
 

Detailed Description

A wrapper class to access fido2 library APIs to interact with the device.

This class abstracts all access to FIDO device.

Constructor & Destructor Documentation

◆ fido_prepare_assert()

fido_prepare_assert::fido_prepare_assert ( )

Construcutor to allocate memory for performing assertion (authentication)

◆ ~fido_prepare_assert()

fido_prepare_assert::~fido_prepare_assert ( )

Standard destructor.

Member Function Documentation

◆ get_authdata_len()

size_t fido_prepare_assert::get_authdata_len ( )
private

Method to get length of authenticator data.

Return values
lengthof authenticator data

◆ get_authdata_ptr()

const unsigned char * fido_prepare_assert::get_authdata_ptr ( )
private

Method to get authenticator data.

Return values
bufferholding authenticator data

◆ get_signature_len()

size_t fido_prepare_assert::get_signature_len ( )
private

Method to get length of signature.

Return values
lengthof signature

◆ get_signature_ptr()

const unsigned char * fido_prepare_assert::get_signature_ptr ( )
private

Method to get signature.

Return values
bufferholding signature data

◆ get_signed_challenge()

void fido_prepare_assert::get_signed_challenge ( unsigned char **  challenge_res,
size_t &  challenge_res_len 
)

This method will extract authenticator data, signature from fido_assert_t struct.

Parameters
[out]challenge_resbuffer to signed challenge
[out]challenge_res_lenlength of signed challenge

◆ parse_challenge()

bool fido_prepare_assert::parse_challenge ( const unsigned char *  challenge)

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

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

Parameters
[in]challengebuffer holding the server challenge
Return values
falsereceived challenge was valid
truereceived challenge was corrupt

◆ set_cred_id()

void fido_prepare_assert::set_cred_id ( unsigned char *  cred,
size_t  len 
)
private

Set method to set credential ID.

Parameters
[in]credbuffer holding credential ID
[in]lenlength of credential ID

◆ set_rp_id()

void fido_prepare_assert::set_rp_id ( const char *  rp_id)
private

Method to set the relying party name or id.

Parameters
[in]rp_idbuffer holding relying party name

◆ set_scramble()

void fido_prepare_assert::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

◆ sign_challenge()

bool fido_prepare_assert::sign_challenge ( )

Method to obtains an assertion from a FIDO device.

Return values
falseassertion successful.
trueassertion failed.

Member Data Documentation

◆ m_assert

fido_assert_t* fido_prepare_assert::m_assert
private

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