FIDO_BIO_TEMPLATE(3)

πŸ“¦
version 1.17.0 Β· 2 versions
  • 1.17.0 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.10.0 Β· ubuntu jammy
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– FIDO_BIO_TEMPLATE(3) πŸ’–

ok so bestie, this is the FIDO_BIO_TEMPLATE(3) page from the Library Functions Manual, and we are about to get so cozy with the FIDO2 biometric template API. grab a boba, we're doing this πŸ§‹βœ¨


✨ NAME ✨

fido_bio_template, fido_bio_template_array_count, fido_bio_template_array_free, fido_bio_template_array_new, fido_bio_template_free, fido_bio_template_id_len, fido_bio_template_id_ptr, fido_bio_template_name, fido_bio_template_new, fido_bio_template_set_id, fido_bio_template_set_name β€” it's giving FIDO2 biometric template API πŸ’…


🌸 SYNOPSIS 🌸

#include <fido.h>
#include <fido/bio.h>

fido_bio_template_t *
fido_bio_template_new(void);

void
fido_bio_template_free(fido_bio_template_t **template_p);

const char *
fido_bio_template_name(const fido_bio_template_t *template);

const unsigned char *
fido_bio_template_id_ptr(const fido_bio_template_t *template);

size_t
fido_bio_template_id_len(const fido_bio_template_t *template);

int
fido_bio_template_set_id(fido_bio_template_t *template,
    const unsigned char *ptr, size_t len);

int
fido_bio_template_set_name(fido_bio_template_t *template,
    const char *name);

fido_bio_template_array_t *
fido_bio_template_array_new(void);

void
fido_bio_template_array_free(fido_bio_template_array_t **array_p);

size_t
fido_bio_template_array_count(const fido_bio_template_array_t *array);

const fido_bio_template_t *
fido_bio_template(const fido_bio_template_array_t *array, size_t idx);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, existing FIDO2 biometric enrollments? libfido2 abstracts them with two types: fido_bio_template_t and fido_bio_template_array_t. iconic of them honestly πŸ‘‘

the functions on this page let you allocate, deallocate, change, and inspect a fido_bio_template_t, and allocate, deallocate, and inspect a fido_bio_template_array_t. no cap.

but bestie, for device operations on fido_bio_template_t and fido_bio_template_array_t, go check out fido_bio_dev_get_info(3) instead. that's a different page, different vibe 🫢

πŸ’« the template functions πŸ’«

fido_bio_template_new() β€” hands you a pointer to a freshly allocated, empty fido_bio_template_t. and if memory can't be allocated? you get NULL. rude but true 😭

fido_bio_template_free() β€” releases the memory backing *template_p, and heads up, *template_p must have been previously allocated by fido_bio_template_new(). on return, *template_p gets set to NULL. and plot twist: either template_p or *template_p may be NULL, and in that case fido_bio_template_free() is a NOP. no drama, no crash πŸ’…

fido_bio_template_name() β€” returns a pointer to a NUL-terminated string holding the friendly name of template. or NULL if template doesn't have a friendly name set. it's giving "no name, no problem" ✨

fido_bio_template_id_ptr() β€” returns a pointer to the template id of template, or NULL if template doesn't have an id. and the matching length? get that with fido_bio_template_id_len() πŸ“

fido_bio_template_set_name() β€” sets the friendly name of template to name. and if name is NULL? the friendly name of template gets unset. we love a clean slate 🌈


🌟 the template array functions 🌟

fido_bio_template_array_new() β€” returns a pointer to a newly allocated, empty fido_bio_template_array_t. if memory cannot be allocated, NULL is returned. same energy as before fr fr πŸ’€

fido_bio_template_array_free() β€” releases the memory backing *array_p, where *array_p must have been previously allocated by fido_bio_template_array_new(). on return, *array_p is set to NULL. either array_p or *array_p may be NULL, in which case fido_bio_template_array_free() is a NOP πŸŽ€

fido_bio_template_array_count() β€” returns the number of templates in array. simple. slay. count them bestie πŸ”’

fido_bio_template() β€” returns a pointer to the template at index idx in array. and please note: the first template in array has an idx (index) value of 0. zero-indexed, as the universe intended ⭐


πŸ‘‘ RETURN VALUES πŸ‘‘

the error codes returned by fido_bio_template_set_id() and fido_bio_template_set_name() are defined in <fido/err.h>. and on success? you get FIDO_OK πŸ’š periodt.


πŸ”₯ SEE ALSO πŸ”₯


ok that's the whole page bestie, you ate it up πŸ’…βœ¨ this was Debian's FIDO_BIO_TEMPLATE(3) from September 13, 2019 β€” yes she's a lil vintage, but she's still main character energy πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from