fido_assert_new
,
fido_assert_free
,
fido_assert_count
,
fido_assert_rp_id
,
fido_assert_user_display_name
,
fido_assert_user_icon
,
fido_assert_user_name
,
fido_assert_authdata_ptr
,
fido_assert_clientdata_hash_ptr
,
fido_assert_hmac_secret_ptr
,
fido_assert_user_id_ptr
,
fido_assert_sig_ptr
,
fido_assert_id_ptr
,
fido_assert_authdata_len
,
fido_assert_clientdata_hash_len
,
fido_assert_hmac_secret_len
,
fido_assert_user_id_len
,
fido_assert_sig_len
,
fido_assert_id_len
,
fido_assert_sigcount
,
fido_assert_flags
—
FIDO 2 assertion API
#include
<fido.h>
fido_assert_t *
fido_assert_new
(
void);
void
fido_assert_free
(
fido_assert_t
**assert_p);
size_t
fido_assert_count
(
const
fido_assert_t *assert);
const char *
fido_assert_rp_id
(
const
fido_assert_t *assert);
const char *
fido_assert_user_display_name
(
const
fido_assert_t *assert,
size_t idx);
const char *
fido_assert_user_icon
(
const
fido_assert_t *assert,
size_t idx);
const char *
fido_assert_user_name
(
const
fido_assert_t *assert,
size_t idx);
const unsigned char *
fido_assert_authdata_ptr
(
const
fido_assert_t *assert,
size_t idx);
const unsigned char *
fido_assert_clientdata_hash_ptr
(
const
fido_assert_t *assert);
const unsigned char *
fido_assert_hmac_secret_ptr
(
const
fido_assert_t *assert,
size_t idx);
const unsigned char *
fido_assert_user_id_ptr
(
const
fido_assert_t *assert,
size_t idx);
const unsigned char *
fido_assert_sig_ptr
(
const
fido_assert_t *assert,
size_t idx);
const unsigned char *
fido_assert_id_ptr
(
const
fido_assert_t *assert,
size_t idx);
size_t
fido_assert_authdata_len
(
const
fido_assert_t *assert,
size_t idx);
size_t
fido_assert_clientdata_hash_len
(
const
fido_assert_t *assert);
size_t
fido_assert_hmac_secret_len
(
const
fido_assert_t *assert,
size_t idx);
size_t
fido_assert_user_id_len
(
const
fido_assert_t *assert,
size_t idx);
size_t
fido_assert_sig_len
(
const
fido_assert_t *assert,
size_t idx);
size_t
fido_assert_id_len
(
const
fido_assert_t *assert,
size_t idx);
uint32_t
fido_assert_sigcount
(
const
fido_assert_t *assert,
size_t idx);
uint8_t
fido_assert_flags
(
const
fido_assert_t *assert,
size_t idx);
FIDO 2 assertions are abstracted in
libfido2 by the
fido_assert_t type. The functions described
in this page allow a
fido_assert_t type to be
allocated, deallocated, and inspected. For other operations on
fido_assert_t, please refer to
fido_assert_set_authdata(3),
fido_assert_allow_cred(3),
fido_assert_verify(3),
and
fido_dev_get_assert(3).
The
fido_assert_new
() function returns a
pointer to a newly allocated, empty
fido_assert_t type. If memory cannot be
allocated, NULL is returned.
The
fido_assert_free
() function releases the
memory backing
*assert_p, where
*assert_p must have been previously allocated
by
fido_assert_new
(). On return,
*assert_p is set to NULL. Either
assert_p or
*assert_p may be NULL, in which case
fido_assert_free
() is a NOP.
The
fido_assert_count
() function returns the
number of statements in
assert.
The
fido_assert_rp_id
() function returns a
pointer to a NUL-terminated string holding the relying party ID of
assert.
The
fido_assert_user_display_name
(),
fido_assert_user_icon
(), and
fido_assert_user_name
(), functions return
pointers to the user display name, icon, and name attributes of statement
idx in
assert. If not NULL, the values returned by
these functions point to NUL-terminated UTF-8 strings.
The
fido_assert_user_id_ptr
(),
fido_assert_authdata_ptr
(),
fido_assert_hmac_secret_ptr
(),
fido_assert_sig_ptr
(), and
fido_assert_id_ptr
() functions return
pointers to the user ID, authenticator data, hmac-secret, signature, and
credential ID attributes of statement
idx in
assert. The
fido_assert_user_id_len
(),
fido_assert_authdata_len
(),
fido_assert_hmac_secret_len
(),
fido_assert_sig_len
(), and
fido_assert_id_len
() functions can be used
to retrieve the corresponding length of a specific attribute.
The
fido_assert_sigcount
() function can be
used to obtain the signature counter of statement
idx in
assert.
The
fido_assert_flags
() function returns the
authenticator data flags of statement
idx in
assert.
Please note that the first statement in
assert
has an
idx (index) value of 0.
The authenticator data and signature parts of an assertion statement are
typically passed to a FIDO 2 server for verification.
The
fido_assert_clientdata_hash_ptr
()
function returns a pointer to the client data hash of
assert. The corresponding length can be
obtained by
fido_assert_clientdata_hash_len
().
The
fido_assert_user_display_name
(),
fido_assert_user_icon
(),
fido_assert_user_name
(),
fido_assert_authdata_ptr
(),
fido_assert_clientdata_hash_ptr
(),
fido_assert_user_id_ptr
(), and
fido_assert_sig_ptr
() functions return NULL
if the respective field in
assert is not set.
If not NULL, returned pointers are guaranteed to exist until any API function
that takes
assert without the
const qualifier is invoked.
fido_assert_allow_cred(3),
fido_assert_set_authdata(3),
fido_assert_verify(3),
fido_dev_get_assert(3)