10afa8e06SEd Maste.\" Copyright (c) 2019 Yubico AB. All rights reserved. 2*2ccfa855SEd Maste.\" 3*2ccfa855SEd Maste.\" Redistribution and use in source and binary forms, with or without 4*2ccfa855SEd Maste.\" modification, are permitted provided that the following conditions are 5*2ccfa855SEd Maste.\" met: 6*2ccfa855SEd Maste.\" 7*2ccfa855SEd Maste.\" 1. Redistributions of source code must retain the above copyright 8*2ccfa855SEd Maste.\" notice, this list of conditions and the following disclaimer. 9*2ccfa855SEd Maste.\" 2. Redistributions in binary form must reproduce the above copyright 10*2ccfa855SEd Maste.\" notice, this list of conditions and the following disclaimer in 11*2ccfa855SEd Maste.\" the documentation and/or other materials provided with the 12*2ccfa855SEd Maste.\" distribution. 13*2ccfa855SEd Maste.\" 14*2ccfa855SEd Maste.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15*2ccfa855SEd Maste.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16*2ccfa855SEd Maste.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17*2ccfa855SEd Maste.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 18*2ccfa855SEd Maste.\" HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19*2ccfa855SEd Maste.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 20*2ccfa855SEd Maste.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21*2ccfa855SEd Maste.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22*2ccfa855SEd Maste.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23*2ccfa855SEd Maste.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24*2ccfa855SEd Maste.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25*2ccfa855SEd Maste.\" 26*2ccfa855SEd Maste.\" SPDX-License-Identifier: BSD-2-Clause 270afa8e06SEd Maste.\" 280afa8e06SEd Maste.Dd $Mdocdate: September 13 2019 $ 290afa8e06SEd Maste.Dt FIDO_BIO_TEMPLATE 3 300afa8e06SEd Maste.Os 310afa8e06SEd Maste.Sh NAME 320afa8e06SEd Maste.Nm fido_bio_template , 330afa8e06SEd Maste.Nm fido_bio_template_array_count , 340afa8e06SEd Maste.Nm fido_bio_template_array_free , 350afa8e06SEd Maste.Nm fido_bio_template_array_new , 360afa8e06SEd Maste.Nm fido_bio_template_free , 370afa8e06SEd Maste.Nm fido_bio_template_id_len , 380afa8e06SEd Maste.Nm fido_bio_template_id_ptr , 390afa8e06SEd Maste.Nm fido_bio_template_name , 400afa8e06SEd Maste.Nm fido_bio_template_new , 410afa8e06SEd Maste.Nm fido_bio_template_set_id , 420afa8e06SEd Maste.Nm fido_bio_template_set_name 430afa8e06SEd Maste.Nd FIDO2 biometric template API 440afa8e06SEd Maste.Sh SYNOPSIS 450afa8e06SEd Maste.In fido.h 460afa8e06SEd Maste.In fido/bio.h 470afa8e06SEd Maste.Ft fido_bio_template_t * 480afa8e06SEd Maste.Fn fido_bio_template_new "void" 490afa8e06SEd Maste.Ft void 500afa8e06SEd Maste.Fn fido_bio_template_free "fido_bio_template_t **template_p" 510afa8e06SEd Maste.Ft const char * 520afa8e06SEd Maste.Fn fido_bio_template_name "const fido_bio_template_t *template" 530afa8e06SEd Maste.Ft const unsigned char * 540afa8e06SEd Maste.Fn fido_bio_template_id_ptr "const fido_bio_template_t *template" 550afa8e06SEd Maste.Ft size_t 560afa8e06SEd Maste.Fn fido_bio_template_id_len "const fido_bio_template_t *template" 570afa8e06SEd Maste.Ft int 580afa8e06SEd Maste.Fn fido_bio_template_set_id "fido_bio_template_t *template" "const unsigned char *ptr" "size_t len" 590afa8e06SEd Maste.Ft int 600afa8e06SEd Maste.Fn fido_bio_template_set_name "fido_bio_template_t *template" "const char *name" 610afa8e06SEd Maste.Ft fido_bio_template_array_t * 620afa8e06SEd Maste.Fn fido_bio_template_array_new "void" 630afa8e06SEd Maste.Ft void 640afa8e06SEd Maste.Fn fido_bio_template_array_free "fido_bio_template_array_t **array_p" 650afa8e06SEd Maste.Ft size_t 660afa8e06SEd Maste.Fn fido_bio_template_array_count "const fido_bio_template_array_t *array" 670afa8e06SEd Maste.Ft const fido_bio_template_t * 680afa8e06SEd Maste.Fn fido_bio_template "const fido_bio_template_array_t *array" "size_t idx" 690afa8e06SEd Maste.Sh DESCRIPTION 700afa8e06SEd MasteExisting FIDO2 biometric enrollments are abstracted in 710afa8e06SEd Maste.Em libfido2 720afa8e06SEd Masteby the 730afa8e06SEd Maste.Vt fido_bio_template_t 740afa8e06SEd Masteand 750afa8e06SEd Maste.Vt fido_bio_template_array_t 760afa8e06SEd Mastetypes. 770afa8e06SEd Maste.Pp 780afa8e06SEd MasteThe functions described in this page allow a 790afa8e06SEd Maste.Vt fido_bio_template_t 800afa8e06SEd Mastetype to be allocated, deallocated, changed, and inspected, 810afa8e06SEd Masteand a 820afa8e06SEd Maste.Vt fido_bio_template_array_t 830afa8e06SEd Mastetype to be allocated, deallocated, and inspected. 840afa8e06SEd MasteFor device operations on 850afa8e06SEd Maste.Vt fido_bio_template_t 860afa8e06SEd Masteand 870afa8e06SEd Maste.Vt fido_bio_template_array_t , 880afa8e06SEd Masteplease refer to 890afa8e06SEd Maste.Xr fido_bio_dev_get_info 3 . 900afa8e06SEd Maste.Pp 910afa8e06SEd MasteThe 920afa8e06SEd Maste.Fn fido_bio_template_new 930afa8e06SEd Mastefunction returns a pointer to a newly allocated, empty 940afa8e06SEd Maste.Vt fido_bio_template_t 950afa8e06SEd Mastetype. 960afa8e06SEd MasteIf memory cannot be allocated, NULL is returned. 970afa8e06SEd Maste.Pp 980afa8e06SEd MasteThe 990afa8e06SEd Maste.Fn fido_bio_template_free 1000afa8e06SEd Mastefunction releases the memory backing 1010afa8e06SEd Maste.Fa *template_p , 1020afa8e06SEd Mastewhere 1030afa8e06SEd Maste.Fa *template_p 1040afa8e06SEd Mastemust have been previously allocated by 1050afa8e06SEd Maste.Fn fido_bio_template_new . 1060afa8e06SEd MasteOn return, 1070afa8e06SEd Maste.Fa *template_p 1080afa8e06SEd Masteis set to NULL. 1090afa8e06SEd MasteEither 1100afa8e06SEd Maste.Fa template_p 1110afa8e06SEd Masteor 1120afa8e06SEd Maste.Fa *template_p 1130afa8e06SEd Mastemay be NULL, in which case 1140afa8e06SEd Maste.Fn fido_bio_template_free 1150afa8e06SEd Masteis a NOP. 1160afa8e06SEd Maste.Pp 1170afa8e06SEd MasteThe 1180afa8e06SEd Maste.Fn fido_bio_template_name 1190afa8e06SEd Mastefunction returns a pointer to a NUL-terminated string containing 1200afa8e06SEd Mastethe friendly name of 1210afa8e06SEd Maste.Fa template , 1220afa8e06SEd Masteor NULL if 1230afa8e06SEd Maste.Fa template 1240afa8e06SEd Mastedoes not have a friendly name set. 1250afa8e06SEd Maste.Pp 1260afa8e06SEd MasteThe 1270afa8e06SEd Maste.Fn fido_bio_template_id_ptr 1280afa8e06SEd Mastefunction returns a pointer to the template id of 1290afa8e06SEd Maste.Fa template , 1300afa8e06SEd Masteor NULL if 1310afa8e06SEd Maste.Fa template 1320afa8e06SEd Mastedoes not have an id. 1330afa8e06SEd MasteThe corresponding length can be obtained by 1340afa8e06SEd Maste.Fn fido_bio_template_id_len . 1350afa8e06SEd Maste.Pp 1360afa8e06SEd MasteThe 1370afa8e06SEd Maste.Fn fido_bio_template_set_name 1380afa8e06SEd Mastefunction sets the friendly name of 1390afa8e06SEd Maste.Fa template 1400afa8e06SEd Masteto 1410afa8e06SEd Maste.Fa name . 1420afa8e06SEd MasteIf 1430afa8e06SEd Maste.Fa name 1440afa8e06SEd Masteis NULL, the friendly name of 1450afa8e06SEd Maste.Fa template 1460afa8e06SEd Masteis unset. 1470afa8e06SEd Maste.Pp 1480afa8e06SEd MasteThe 1490afa8e06SEd Maste.Fn fido_bio_template_array_new 1500afa8e06SEd Mastefunction returns a pointer to a newly allocated, empty 1510afa8e06SEd Maste.Vt fido_bio_template_array_t 1520afa8e06SEd Mastetype. 1530afa8e06SEd MasteIf memory cannot be allocated, NULL is returned. 1540afa8e06SEd Maste.Pp 1550afa8e06SEd MasteThe 1560afa8e06SEd Maste.Fn fido_bio_template_array_free 1570afa8e06SEd Mastefunction releases the memory backing 1580afa8e06SEd Maste.Fa *array_p , 1590afa8e06SEd Mastewhere 1600afa8e06SEd Maste.Fa *array_p 1610afa8e06SEd Mastemust have been previously allocated by 1620afa8e06SEd Maste.Fn fido_bio_template_array_new . 1630afa8e06SEd MasteOn return, 1640afa8e06SEd Maste.Fa *array_p 1650afa8e06SEd Masteis set to NULL. 1660afa8e06SEd MasteEither 1670afa8e06SEd Maste.Fa array_p 1680afa8e06SEd Masteor 1690afa8e06SEd Maste.Fa *array_p 1700afa8e06SEd Mastemay be NULL, in which case 1710afa8e06SEd Maste.Fn fido_bio_template_array_free 1720afa8e06SEd Masteis a NOP. 1730afa8e06SEd Maste.Pp 1740afa8e06SEd MasteThe 1750afa8e06SEd Maste.Fn fido_bio_template_array_count 1760afa8e06SEd Mastefunction returns the number of templates in 1770afa8e06SEd Maste.Fa array . 1780afa8e06SEd Maste.Pp 1790afa8e06SEd MasteThe 1800afa8e06SEd Maste.Fn fido_bio_template 1810afa8e06SEd Mastefunction returns a pointer to the template at index 1820afa8e06SEd Maste.Fa idx 1830afa8e06SEd Mastein 1840afa8e06SEd Maste.Fa array . 1850afa8e06SEd MastePlease note that the first template in 1860afa8e06SEd Maste.Fa array 1870afa8e06SEd Mastehas an 1880afa8e06SEd Maste.Fa idx 1890afa8e06SEd Maste(index) value of 0. 1900afa8e06SEd Maste.Sh RETURN VALUES 1910afa8e06SEd MasteThe error codes returned by 1920afa8e06SEd Maste.Fn fido_bio_template_set_id 1930afa8e06SEd Masteand 1940afa8e06SEd Maste.Fn fido_bio_template_set_name 1950afa8e06SEd Masteare defined in 1960afa8e06SEd Maste.In fido/err.h . 1970afa8e06SEd MasteOn success, 1980afa8e06SEd Maste.Dv FIDO_OK 1990afa8e06SEd Masteis returned. 2000afa8e06SEd Maste.Sh SEE ALSO 2010afa8e06SEd Maste.Xr fido_bio_dev_get_info 3 , 2020afa8e06SEd Maste.Xr fido_bio_enroll_new 3 203