---
name: "fido_bio_template"
section: "3"
platform: "linux"
package: "libfido2"
version: "1.17.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/fido_bio_template"
---

# fido\_bio\_template(3)

FIDO2 biometric template API

## 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** – 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

Existing FIDO2 biometric enrollments are abstracted in *libfido2* by the *fido\_bio\_template\_t* and *fido\_bio\_template\_array\_t* types.

The functions described in this page allow a *fido\_bio\_template\_t* type to be allocated, deallocated, changed, and inspected, and a *fido\_bio\_template\_array\_t* type to be allocated, deallocated, and inspected. For device operations on *fido\_bio\_template\_t* and *fido\_bio\_template\_array\_t*, please refer to [fido\_bio\_dev\_get\_info(3)](/fido_bio_dev_get_info/3.md).

The **fido\_bio\_template\_new**() function returns a pointer to a newly allocated, empty *fido\_bio\_template\_t* type. If memory cannot be allocated, NULL is returned.

The **fido\_bio\_template\_free**() function releases the memory backing *\*template\_p*, where *\*template\_p* must have been previously allocated by **fido\_bio\_template\_new**(). On return, *\*template\_p* is set to NULL. Either *template\_p* or *\*template\_p* may be NULL, in which case **fido\_bio\_template\_free**() is a NOP.

The **fido\_bio\_template\_name**() function returns a pointer to a NUL-terminated string containing the friendly name of *template*, or NULL if *template* does not have a friendly name set.

The **fido\_bio\_template\_id\_ptr**() function returns a pointer to the template id of *template*, or NULL if *template* does not have an id. The corresponding length can be obtained by **fido\_bio\_template\_id\_len**().

The **fido\_bio\_template\_set\_name**() function sets the friendly name of *template* to *name*. If *name* is NULL, the friendly name of *template* is unset.

The **fido\_bio\_template\_array\_new**() function returns a pointer to a newly allocated, empty *fido\_bio\_template\_array\_t* type. If memory cannot be allocated, NULL is returned.

The **fido\_bio\_template\_array\_free**() function 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.

The **fido\_bio\_template\_array\_count**() function returns the number of templates in *array*.

The **fido\_bio\_template**() function returns a pointer to the template at index *idx* in *array*. Please note that the first template in *array* has an *idx* (index) value of 0.

## RETURN VALUES

The error codes returned by **fido\_bio\_template\_set\_id**() and **fido\_bio\_template\_set\_name**() are defined in ⟨fido/err.h⟩. On success, FIDO\_OK is returned.

## SEE ALSO

[fido\_bio\_dev\_get\_info(3)](/fido_bio_dev_get_info/3.md), [fido\_bio\_enroll\_new(3)](/fido_bio_enroll_new/3.md)
