1FIDO_CRED_NEW(3)         BSD Library Functions Manual         FIDO_CRED_NEW(3)
2

NAME

4     fido_cred_new, fido_cred_free, fido_cred_fmt, fido_cred_authdata_ptr,
5     fido_cred_clientdata_hash_ptr, fido_cred_id_ptr, fido_cred_pubkey_ptr,
6     fido_cred_sig_ptr, fido_cred_x5c_ptr, fido_cred_authdata_len,
7     fido_cred_clientdata_hash_len, fido_cred_id_len, fido_cred_pubkey_len,
8     fido_cred_sig_len, fido_cred_x5c_len — FIDO 2 credential API
9

SYNOPSIS

11     #include <fido.h>
12
13     fido_cred_t *
14     fido_cred_new(void);
15
16     void
17     fido_cred_free(fido_cred_t **cred_p);
18
19     const char *
20     fido_cred_fmt(const fido_cred_t *cred);
21
22     const unsigned char *
23     fido_cred_authdata_ptr(const fido_cred_t *cred);
24
25     const unsigned char *
26     fido_cred_clientdata_hash_ptr(const fido_cred_t *cred);
27
28     const unsigned char *
29     fido_cred_id_ptr(const fido_cred_t *cred);
30
31     const unsigned char *
32     fido_cred_pubkey_ptr(const fido_cred_t *cred);
33
34     const unsigned char *
35     fido_cred_sig_ptr(const fido_cred_t *cred);
36
37     const unsigned char *
38     fido_cred_x5c_ptr(const fido_cred_t *cred);
39
40     size_t
41     fido_cred_authdata_len(const fido_cred_t *cred);
42
43     size_t
44     fido_cred_clientdata_hash_len(const fido_cred_t *cred);
45
46     size_t
47     fido_cred_id_len(const fido_cred_t *cred);
48
49     size_t
50     fido_cred_pubkey_len(const fido_cred_t *cred);
51
52     size_t
53     fido_cred_sig_len(const fido_cred_t *cred);
54
55     size_t
56     fido_cred_x5c_len(const fido_cred_t *cred);
57

DESCRIPTION

59     FIDO 2 credentials are abstracted in libfido2 by the fido_cred_t type.
60     The functions described in this page allow a fido_cred_t type to be allo‐
61     cated, deallocated, and inspected.  For other operations on fido_cred_t,
62     please refer to fido_cred_set_authdata(3), fido_cred_exclude(3),
63     fido_cred_verify(3), and fido_dev_make_cred(3).
64
65     The fido_cred_new() function returns a pointer to a newly allocated,
66     empty fido_cred_t type.  If memory cannot be allocated, NULL is returned.
67
68     The fido_cred_free() function releases the memory backing *cred_p, where
69     *cred_p must have been previously allocated by fido_cred_new().  On
70     return, *cred_p is set to NULL.  Either cred_p or *cred_p may be NULL, in
71     which case fido_cred_free() is a NOP.
72
73     The fido_cred_fmt() function returns a pointer to a NUL-terminated string
74     containing the format of cred, or NULL if cred does not have a format
75     set.
76
77     The fido_cred_authdata_ptr(), fido_cred_clientdata_hash_ptr(),
78     fido_cred_id_ptr(), fido_cred_pubkey_ptr(), fido_cred_sig_ptr(), and
79     fido_cred_x5c_ptr() functions return pointers to the authenticator data,
80     client data hash, ID, public key, signature and x509 certificate parts of
81     cred, or NULL if the respective entry is not set.
82
83     The corresponding length can be obtained by fido_cred_authdata_len(),
84     fido_cred_clientdata_hash_len(), fido_cred_id_len(),
85     fido_cred_pubkey_len(), and fido_cred_sig_len().
86
87     The authenticator data, x509 certificate, and signature parts of a cre‐
88     dential are typically passed to a FIDO 2 server for verification.
89

RETURN VALUES

91     The authenticator data returned by fido_cred_authdata_ptr() is a CBOR-
92     encoded byte string, as obtained from the authenticator.
93
94     If not NULL, pointers returned by fido_cred_fmt(),
95     fido_cred_authdata_ptr(), fido_cred_clientdata_hash_ptr(),
96     fido_cred_id_ptr(), fido_cred_pubkey_ptr(), fido_cred_sig_ptr(), and
97     fido_cred_x5c_ptr() are guaranteed to exist until any API function that
98     takes cred without the const qualifier is invoked.
99

SEE ALSO

101     fido_cred_exclude(3), fido_cred_set_authdata(3), fido_cred_verify(3),
102     fido_credman_metadata_new(3), fido_dev_make_cred(3)
103
104BSD                              May 10, 2020                              BSD
Impressum