---
name: "fido_dev_make_cred"
section: "3"
platform: "linux"
package: "libfido2"
version: "1.17.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/fido_dev_make_cred"
---

# fido\_dev\_make\_cred(3)

generates a new credential on a FIDO2 device

## NAME

**fido\_dev\_make\_cred** – generates a new credential on a FIDO2 device

## SYNOPSIS

**#include \<fido.h\>**

*int*\

**fido\_dev\_make\_cred**(*fido\_dev\_t \*dev*, *fido\_cred\_t \*cred*, *const char \*pin*);

## DESCRIPTION

The **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)](/fido_cred_set_authdata/3.md) 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**(), the [fido\_cred\_authdata\_ptr(3)](/fido_cred_authdata_ptr/3.md), [fido\_cred\_pubkey\_ptr(3)](/fido_cred_pubkey_ptr/3.md), [fido\_cred\_x5c\_ptr(3)](/fido_cred_x5c_ptr/3.md), and [fido\_cred\_sig\_ptr(3)](/fido_cred_sig_ptr/3.md) functions may be invoked on *cred* to retrieve the various parts of the generated credential.

Please note that **fido\_dev\_make\_cred**() is synchronous and will block if necessary.

## 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

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