xref: /freebsd/contrib/libfido2/man/fido_bio_info_new.3 (revision edf8578117e8844e02c0121147f45e4609b30680)
1.\" Copyright (c) 2019 Yubico AB. All rights reserved.
2.\"
3.\" Redistribution and use in source and binary forms, with or without
4.\" modification, are permitted provided that the following conditions are
5.\" met:
6.\"
7.\"    1. Redistributions of source code must retain the above copyright
8.\"       notice, this list of conditions and the following disclaimer.
9.\"    2. Redistributions in binary form must reproduce the above copyright
10.\"       notice, this list of conditions and the following disclaimer in
11.\"       the documentation and/or other materials provided with the
12.\"       distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18.\" HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25.\"
26.\" SPDX-License-Identifier: BSD-2-Clause
27.\"
28.Dd $Mdocdate: September 13 2019 $
29.Dt FIDO_BIO_INFO_NEW 3
30.Os
31.Sh NAME
32.Nm fido_bio_info_new ,
33.Nm fido_bio_info_free ,
34.Nm fido_bio_info_type ,
35.Nm fido_bio_info_max_samples
36.Nd FIDO2 biometric sensor information API
37.Sh SYNOPSIS
38.In fido.h
39.In fido/bio.h
40.Ft fido_bio_info_t *
41.Fn fido_bio_info_new "void"
42.Ft void
43.Fn fido_bio_info_free "fido_bio_info_t **info_p"
44.Ft uint8_t
45.Fn fido_bio_info_type "const fido_bio_info_t *info"
46.Ft uint8_t
47.Fn fido_bio_info_max_samples "const fido_bio_info_t *info"
48.Sh DESCRIPTION
49Biometric sensor metadata is abstracted in
50.Em libfido2
51by the
52.Vt fido_bio_info_t
53type.
54.Pp
55The functions described in this page allow a
56.Vt fido_bio_info_t
57type to be allocated, deallocated, and inspected.
58For device operations on
59.Vt fido_bio_info_t ,
60please refer to
61.Xr fido_bio_dev_get_info 3 .
62.Pp
63The
64.Fn fido_bio_info_new
65function returns a pointer to a newly allocated, empty
66.Vt fido_bio_info_t
67type.
68If memory cannot be allocated, NULL is returned.
69.Pp
70The
71.Fn fido_bio_info_free
72function releases the memory backing
73.Fa *info_p ,
74where
75.Fa *info_p
76must have been previously allocated by
77.Fn fido_bio_info_new .
78On return,
79.Fa *info_p
80is set to NULL.
81Either
82.Fa info_p
83or
84.Fa *info_p
85may be NULL, in which case
86.Fn fido_bio_info_free
87is a NOP.
88.Pp
89The
90.Fn fido_bio_info_type
91function returns the fingerprint sensor type, which is
92.Dv 1
93for touch sensors, and
94.Dv 2
95for swipe sensors.
96.Pp
97The
98.Fn fido_bio_info_max_samples
99function returns the maximum number of successful samples
100required for enrollment.
101.Sh SEE ALSO
102.Xr fido_bio_dev_get_info 3 ,
103.Xr fido_bio_enroll_new 3 ,
104.Xr fido_bio_template 3
105