diff options
Diffstat (limited to 'man/fido_cbor_info_new.3')
-rw-r--r-- | man/fido_cbor_info_new.3 | 153 |
1 files changed, 153 insertions, 0 deletions
diff --git a/man/fido_cbor_info_new.3 b/man/fido_cbor_info_new.3 new file mode 100644 index 0000000..d1e4c41 --- /dev/null +++ b/man/fido_cbor_info_new.3 | |||
@@ -0,0 +1,153 @@ | |||
1 | .\" Copyright (c) 2018 Yubico AB. All rights reserved. | ||
2 | .\" Use of this source code is governed by a BSD-style | ||
3 | .\" license that can be found in the LICENSE file. | ||
4 | .\" | ||
5 | .Dd $Mdocdate: May 24 2018 $ | ||
6 | .Dt FIDO_CBOR_INFO_NEW 3 | ||
7 | .Os | ||
8 | .Sh NAME | ||
9 | .Nm fido_cbor_info_new , | ||
10 | .Nm fido_cbor_info_free , | ||
11 | .Nm fido_dev_get_cbor_info , | ||
12 | .Nm fido_cbor_info_aaguid_ptr , | ||
13 | .Nm fido_cbor_info_extensions_ptr , | ||
14 | .Nm fido_cbor_info_protocols_ptr , | ||
15 | .Nm fido_cbor_info_versions_ptr , | ||
16 | .Nm fido_cbor_info_options_name_ptr , | ||
17 | .Nm fido_cbor_info_options_value_ptr , | ||
18 | .Nm fido_cbor_info_aaguid_len , | ||
19 | .Nm fido_cbor_info_extensions_len , | ||
20 | .Nm fido_cbor_info_protocols_len , | ||
21 | .Nm fido_cbor_info_versions_len , | ||
22 | .Nm fido_cbor_info_options_len , | ||
23 | .Nm fido_cbor_info_maxmsgsiz | ||
24 | .Nd FIDO 2 CBOR Info API | ||
25 | .Sh SYNOPSIS | ||
26 | .In fido.h | ||
27 | .Ft fido_cbor_info_t * | ||
28 | .Fn fido_cbor_info_new "void" | ||
29 | .Ft void | ||
30 | .Fn fido_cbor_info_free "fido_cbor_info_t **ci_p" | ||
31 | .Ft int | ||
32 | .Fn fido_dev_get_cbor_info "fido_dev_t *dev" "fido_cbor_info_t *ci" | ||
33 | .Ft const unsigned char * | ||
34 | .Fn fido_cbor_info_aaguid_ptr "const fido_cbor_info_t *ci" | ||
35 | .Ft char ** | ||
36 | .Fn fido_cbor_info_extensions_ptr "const fido_cbor_info_t *ci" | ||
37 | .Ft const uint8_t * | ||
38 | .Fn fido_cbor_info_protocols_ptr "const fido_cbor_info_t *ci" | ||
39 | .Ft char ** | ||
40 | .Fn fido_cbor_info_versions_ptr "const fido_cbor_info_t *ci" | ||
41 | .Ft char ** | ||
42 | .Fn fido_cbor_info_options_name_ptr "const fido_cbor_info_t *ci" | ||
43 | .Ft const bool * | ||
44 | .Fn fido_cbor_info_options_value_ptr "const fido_cbor_info_t *ci" | ||
45 | .Ft size_t | ||
46 | .Fn fido_cbor_info_aaguid_len "const fido_cbor_info_t *ci" | ||
47 | .Ft size_t | ||
48 | .Fn fido_cbor_info_extensions_len "const fido_cbor_info_t *ci" | ||
49 | .Ft size_t | ||
50 | .Fn fido_cbor_info_protocols_len "const fido_cbor_info_t *ci" | ||
51 | .Ft size_t | ||
52 | .Fn fido_cbor_info_versions_len "const fido_cbor_info_t *ci" | ||
53 | .Ft size_t | ||
54 | .Fn fido_cbor_info_options_len "const fido_cbor_info_t *ci" | ||
55 | .Ft uint64_t | ||
56 | .Fn fido_cbor_info_maxmsgsiz "const fido_cbor_info_t *ci" | ||
57 | .Sh DESCRIPTION | ||
58 | The | ||
59 | .Fn fido_cbor_info_new | ||
60 | function returns a pointer to a newly allocated, empty | ||
61 | .Vt fido_cbor_info_t | ||
62 | type. | ||
63 | If memory cannot be allocated, NULL is returned. | ||
64 | .Pp | ||
65 | The | ||
66 | .Fn fido_cbor_info_free | ||
67 | function releases the memory backing | ||
68 | .Fa *ci_p , | ||
69 | where | ||
70 | .Fa *ci_p | ||
71 | must have been previously allocated by | ||
72 | .Fn fido_cbor_info_new . | ||
73 | On return, | ||
74 | .Fa *ci_p | ||
75 | is set to NULL. | ||
76 | Either | ||
77 | .Fa ci_p | ||
78 | or | ||
79 | .Fa *ci_p | ||
80 | may be NULL, in which case | ||
81 | .Fn fido_cbor_info_free | ||
82 | is a NOP. | ||
83 | .Pp | ||
84 | The | ||
85 | .Fn fido_dev_get_cbor_info | ||
86 | function transmits a | ||
87 | .Dv CTAP_CBOR_GETINFO | ||
88 | command to | ||
89 | .Fa dev | ||
90 | and fills | ||
91 | .Fa ci | ||
92 | with attributes retrieved from the command's response. | ||
93 | The | ||
94 | .Fn fido_dev_get_cbor_info | ||
95 | function may block. | ||
96 | .Pp | ||
97 | The | ||
98 | .Fn fido_cbor_info_aaguid_ptr , | ||
99 | .Fn fido_cbor_info_extensions_ptr , | ||
100 | .Fn fido_cbor_info_protocols_ptr , | ||
101 | and | ||
102 | .Fn fido_cbor_info_versions_ptr | ||
103 | functions return pointers to the AAGUID, supported extensions, | ||
104 | PIN protocol and CTAP version strings of | ||
105 | .Fa ci . | ||
106 | The corresponding length of a given attribute can be | ||
107 | obtained by | ||
108 | .Fn fido_cbor_info_aaguid_len , | ||
109 | .Fn fido_cbor_info_extensions_len , | ||
110 | .Fn fido_cbor_info_protocols_len , | ||
111 | or | ||
112 | .Fn fido_cbor_info_versions_len . | ||
113 | .Pp | ||
114 | The | ||
115 | .Fn fido_cbor_info_options_name_ptr | ||
116 | and | ||
117 | .Fn fido_cbor_info_options_value_ptr | ||
118 | functions return pointers to the array of option names and their | ||
119 | respective values | ||
120 | in | ||
121 | .Fa ci . | ||
122 | The length of the options array is returned by | ||
123 | .Fn fido_cbor_info_options_len . | ||
124 | .Pp | ||
125 | The | ||
126 | .Fn fido_cbor_info_maxmsgsiz | ||
127 | function returns the maximum message size of | ||
128 | .Fa ci . | ||
129 | .Pp | ||
130 | A complete example of how to use these functions can be found in the | ||
131 | .Pa example/info.c | ||
132 | file shipped with | ||
133 | .Em libfido2 . | ||
134 | .Sh RETURN VALUES | ||
135 | The | ||
136 | .Fn fido_cbor_info_aaguid_ptr , | ||
137 | .Fn fido_cbor_info_extensions_ptr , | ||
138 | .Fn fido_cbor_info_protocols_ptr , | ||
139 | .Fn fido_cbor_info_versions_ptr , | ||
140 | .Fn fido_cbor_info_options_name_ptr , | ||
141 | and | ||
142 | .Fn fido_cbor_info_options_value_ptr | ||
143 | functions return NULL if the respective field in | ||
144 | .Fa ci | ||
145 | is absent. | ||
146 | If not NULL, returned pointers are guaranteed to exist until any | ||
147 | API function that takes | ||
148 | .Fa ci | ||
149 | without the | ||
150 | .Em const | ||
151 | qualifier is invoked. | ||
152 | .Sh SEE ALSO | ||
153 | .Xr fido_dev_open 3 | ||