FIDO\_DEV\_MAKE\_CRED(3) Library Functions Manual FIDO\_DEV\_MAKE\_CRED(3)

# [NAME](#NAME)

`fido_dev_make_cred` — generates a new credential on a FIDO2 device

# [SYNOPSIS](#SYNOPSIS)

`#include <fido.h>`

`int`  
`fido_dev_make_cred`(`fido_dev_t *dev`, `fido_cred_t *cred`, `const char *pin`);

# [DESCRIPTION](#DESCRIPTION)

The [`fido_dev_make_cred`](#fido_dev_make_cred)() function asks the FIDO2 device represented by `dev` to generate a new credential according to the following parameters defined in `cred`:

- `type`;
- `client data hash`;
- `relying party`;
- `user attributes`;
- `list of excluded credential IDs`;
- `resident/discoverable key and user verification attributes`.

See [fido\_cred\_set\_authdata(3)](/man/os/libfido2/fido_cred_set_authdata.3) for information on how these values are set.

If a PIN is not needed to authenticate the request against `dev`, then `pin` may be NULL. Otherwise `pin` must point to a NUL-terminated UTF-8 string.

After a successful call to [`fido_dev_make_cred`](#fido_dev_make_cred~2)(), the [fido\_cred\_authdata\_ptr(3)](/man/os/libfido2/fido_cred_authdata_ptr.3), [fido\_cred\_pubkey\_ptr(3)](/man/os/libfido2/fido_cred_pubkey_ptr.3), [fido\_cred\_x5c\_ptr(3)](/man/os/libfido2/fido_cred_x5c_ptr.3), and [fido\_cred\_sig\_ptr(3)](/man/os/libfido2/fido_cred_sig_ptr.3) functions may be invoked on `cred` to retrieve the various parts of the generated credential.

Please note that [`fido_dev_make_cred`](#fido_dev_make_cred~3)() is synchronous and will block if necessary.

# [RETURN VALUES](#RETURN_VALUES)

The error codes returned by `fido_dev_make_cred`() are defined in `<fido/err.h>`. On success, `FIDO_OK` is returned.

# [SEE ALSO](#SEE_ALSO)

[fido\_cred\_new(3)](/man/os/libfido2/fido_cred_new.3), [fido\_cred\_set\_authdata(3)](/man/os/libfido2/fido_cred_set_authdata.3)

May 23, 2018 Linux 4.19.0-gvisor

---

Document: fido_dev_make_cred(3) from libfido2 1.17.0-r7 (Chainguard OS)
Source: https://github.com/Yubico/libfido2
