1FIDO_CRED_NEW(3) BSD Library Functions Manual FIDO_CRED_NEW(3)
2
4 fido_cred_new, fido_cred_free, fido_cred_prot, fido_cred_fmt,
5 fido_cred_authdata_ptr, fido_cred_clientdata_hash_ptr, fido_cred_id_ptr,
6 fido_cred_pubkey_ptr, fido_cred_sig_ptr, fido_cred_x5c_ptr,
7 fido_cred_authdata_len, fido_cred_clientdata_hash_len, fido_cred_id_len,
8 fido_cred_pubkey_len, fido_cred_sig_len, fido_cred_x5c_len — FIDO 2 cre‐
9 dential API
10
12 #include <fido.h>
13
14 fido_cred_t *
15 fido_cred_new(void);
16
17 void
18 fido_cred_free(fido_cred_t **cred_p);
19
20 int
21 fido_cred_prot(fido_cred_t *cred);
22
23 const char *
24 fido_cred_fmt(const fido_cred_t *cred);
25
26 const unsigned char *
27 fido_cred_authdata_ptr(const fido_cred_t *cred);
28
29 const unsigned char *
30 fido_cred_clientdata_hash_ptr(const fido_cred_t *cred);
31
32 const unsigned char *
33 fido_cred_id_ptr(const fido_cred_t *cred);
34
35 const unsigned char *
36 fido_cred_pubkey_ptr(const fido_cred_t *cred);
37
38 const unsigned char *
39 fido_cred_sig_ptr(const fido_cred_t *cred);
40
41 const unsigned char *
42 fido_cred_x5c_ptr(const fido_cred_t *cred);
43
44 size_t
45 fido_cred_authdata_len(const fido_cred_t *cred);
46
47 size_t
48 fido_cred_clientdata_hash_len(const fido_cred_t *cred);
49
50 size_t
51 fido_cred_id_len(const fido_cred_t *cred);
52
53 size_t
54 fido_cred_pubkey_len(const fido_cred_t *cred);
55
56 size_t
57 fido_cred_sig_len(const fido_cred_t *cred);
58
59 size_t
60 fido_cred_x5c_len(const fido_cred_t *cred);
61
63 FIDO 2 credentials are abstracted in libfido2 by the fido_cred_t type.
64 The functions described in this page allow a fido_cred_t type to be allo‐
65 cated, deallocated, and inspected. For other operations on fido_cred_t,
66 please refer to fido_cred_set_authdata(3), fido_cred_exclude(3),
67 fido_cred_verify(3), and fido_dev_make_cred(3).
68
69 The fido_cred_new() function returns a pointer to a newly allocated,
70 empty fido_cred_t type. If memory cannot be allocated, NULL is returned.
71
72 The fido_cred_free() function releases the memory backing *cred_p, where
73 *cred_p must have been previously allocated by fido_cred_new(). On
74 return, *cred_p is set to NULL. Either cred_p or *cred_p may be NULL, in
75 which case fido_cred_free() is a NOP.
76
77 The fido_cred_prot() function returns the protection of cred. See
78 fido_cred_set_prot(3) for the values understood by libfido2.
79
80 The fido_cred_fmt() function returns a pointer to a NUL-terminated string
81 containing the format of cred, or NULL if cred does not have a format
82 set.
83
84 The fido_cred_authdata_ptr(), fido_cred_clientdata_hash_ptr(),
85 fido_cred_id_ptr(), fido_cred_pubkey_ptr(), fido_cred_sig_ptr(), and
86 fido_cred_x5c_ptr() functions return pointers to the authenticator data,
87 client data hash, ID, public key, signature and x509 certificate parts of
88 cred, or NULL if the respective entry is not set.
89
90 The corresponding length can be obtained by fido_cred_authdata_len(),
91 fido_cred_clientdata_hash_len(), fido_cred_id_len(),
92 fido_cred_pubkey_len(), and fido_cred_sig_len().
93
94 The authenticator data, x509 certificate, and signature parts of a cre‐
95 dential are typically passed to a FIDO 2 server for verification.
96
98 The authenticator data returned by fido_cred_authdata_ptr() is a CBOR-
99 encoded byte string, as obtained from the authenticator.
100
101 If not NULL, pointers returned by fido_cred_fmt(),
102 fido_cred_authdata_ptr(), fido_cred_clientdata_hash_ptr(),
103 fido_cred_id_ptr(), fido_cred_pubkey_ptr(), fido_cred_sig_ptr(), and
104 fido_cred_x5c_ptr() are guaranteed to exist until any API function that
105 takes cred without the const qualifier is invoked.
106
108 fido_cred_exclude(3), fido_cred_set_authdata(3), fido_cred_verify(3),
109 fido_credman_metadata_new(3), fido_dev_make_cred(3)
110
111BSD May 23, 2018 BSD