---
name: "fido_cred_authdata_ptr"
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_cred_new"
---

# fido\_cred\_authdata\_ptr(3)

FIDO2 credential API

Part of [fido\_cred\_new(3)](/fido_cred_new/3.md).

## NAME

**fido\_cred\_new**, **fido\_cred\_free**, **fido\_cred\_payment**, **fido\_cred\_pin\_minlen**, **fido\_cred\_prot**, **fido\_cred\_fmt**, **fido\_cred\_rp\_id**, **fido\_cred\_rp\_name**, **fido\_cred\_user\_name**, **fido\_cred\_display\_name**, **fido\_cred\_authdata\_ptr**, **fido\_cred\_authdata\_raw\_ptr**, **fido\_cred\_clientdata\_hash\_ptr**, **fido\_cred\_id\_ptr**, **fido\_cred\_aaguid\_ptr**, **fido\_cred\_hmac\_secret\_ptr**, **fido\_cred\_largeblob\_key\_ptr**, **fido\_cred\_pubkey\_ptr**, **fido\_cred\_sig\_ptr**, **fido\_cred\_user\_id\_ptr**, **fido\_cred\_x5c\_list\_count**, **fido\_cred\_x5c\_list\_ptr**, **fido\_cred\_x5c\_ptr**, **fido\_cred\_attstmt\_ptr**, **fido\_cred\_authdata\_len**, **fido\_cred\_authdata\_raw\_len**, **fido\_cred\_clientdata\_hash\_len**, **fido\_cred\_id\_len**, **fido\_cred\_aaguid\_len**, **fido\_cred\_hmac\_secret\_len**, **fido\_cred\_largeblob\_key\_len**, **fido\_cred\_pubkey\_len**, **fido\_cred\_sig\_len**, **fido\_cred\_user\_id\_len**, **fido\_cred\_x5c\_list\_len**, **fido\_cred\_x5c\_len**, **fido\_cred\_attstmt\_len**, **fido\_cred\_entattest**, **fido\_cred\_type**, **fido\_cred\_flags**, **fido\_cred\_sigcount** – FIDO2 credential API

## SYNOPSIS

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

*fido\_cred\_t* *\**\

**fido\_cred\_new**(*void*);

*void*\

**fido\_cred\_free**(*fido\_cred\_t \*\*cred\_p*);

*bool*\

**fido\_cred\_payment**(*const fido\_cred\_t \*cred*);

*size\_t*\

**fido\_cred\_pin\_minlen**(*const fido\_cred\_t \*cred*);

*int*\

**fido\_cred\_prot**(*const fido\_cred\_t \*cred*);

*const* *char* *\**\

**fido\_cred\_fmt**(*const fido\_cred\_t \*cred*);

*const* *char* *\**\

**fido\_cred\_rp\_id**(*const fido\_cred\_t \*cred*);

*const* *char* *\**\

**fido\_cred\_rp\_name**(*const fido\_cred\_t \*cred*);

*const* *char* *\**\

**fido\_cred\_user\_name**(*const fido\_cred\_t \*cred*);

*const* *char* *\**\

**fido\_cred\_display\_name**(*const fido\_cred\_t \*cred*);

*const* *unsigned* *char* *\**\

**fido\_cred\_authdata\_ptr**(*const fido\_cred\_t \*cred*);

*const* *unsigned* *char* *\**\

**fido\_cred\_authdata\_raw\_ptr**(*const fido\_cred\_t \*cred*);

*const* *unsigned* *char* *\**\

**fido\_cred\_clientdata\_hash\_ptr**(*const fido\_cred\_t \*cred*);

*const* *unsigned* *char* *\**\

**fido\_cred\_id\_ptr**(*const fido\_cred\_t \*cred*);

*const* *unsigned* *char* *\**\

**fido\_cred\_aaguid\_ptr**(*const fido\_cred\_t \*cred*);

*const* *unsigned* *char* *\**\

**fido\_cred\_hmac\_secret\_ptr**(*const fido\_cred\_t \*cred*);

*const* *unsigned* *char* *\**\

**fido\_cred\_largeblob\_key\_ptr**(*const fido\_cred\_t \*cred*);

*const* *unsigned* *char* *\**\

**fido\_cred\_pubkey\_ptr**(*const fido\_cred\_t \*cred*);

*const* *unsigned* *char* *\**\

**fido\_cred\_sig\_ptr**(*const fido\_cred\_t \*cred*);

*const* *unsigned* *char* *\**\

**fido\_cred\_user\_id\_ptr**(*const fido\_cred\_t \*cred*);

*size\_t*\

**fido\_cred\_x5c\_list\_count**(*const fido\_cred\_t \*cred*);

*const* *unsigned* *char* *\**\

**fido\_cred\_x5c\_list\_ptr**(*const fido\_cred\_t \*cred*, *size\_t idx*);

*const* *unsigned* *char* *\**\

**fido\_cred\_x5c\_ptr**(*const fido\_cred\_t \*cred*);

*const* *unsigned* *char* *\**\

**fido\_cred\_attstmt\_ptr**(*const fido\_cred\_t \*cred*);

*size\_t*\

**fido\_cred\_authdata\_len**(*const fido\_cred\_t \*cred*);

*size\_t*\

**fido\_cred\_authdata\_raw\_len**(*const fido\_cred\_t \*cred*);

*size\_t*\

**fido\_cred\_clientdata\_hash\_len**(*const fido\_cred\_t \*cred*);

*size\_t*\

**fido\_cred\_id\_len**(*const fido\_cred\_t \*cred*);

*size\_t*\

**fido\_cred\_aaguid\_len**(*const fido\_cred\_t \*cred*);

*size\_t*\

**fido\_cred\_hmac\_secret\_len**(*const fido\_cred\_t \*cred*);

*size\_t*\

**fido\_cred\_largeblob\_key\_len**(*const fido\_cred\_t \*cred*);

*size\_t*\

**fido\_cred\_pubkey\_len**(*const fido\_cred\_t \*cred*);

*size\_t*\

**fido\_cred\_sig\_len**(*const fido\_cred\_t \*cred*);

*size\_t*\

**fido\_cred\_user\_id\_len**(*const fido\_cred\_t \*cred*);

*size\_t*\

**fido\_cred\_x5c\_list\_len**(*const fido\_cred\_t \*cred*, *size\_t idx*);

*size\_t*\

**fido\_cred\_x5c\_len**(*const fido\_cred\_t \*cred*);

*size\_t*\

**fido\_cred\_attstmt\_len**(*const fido\_cred\_t \*cred*);

*bool*\

**fido\_cred\_entattest**(*const fido\_cred\_t \*cred*);

*int*\

**fido\_cred\_type**(*const fido\_cred\_t \*cred*);

*uint8\_t*\

**fido\_cred\_flags**(*const fido\_cred\_t \*cred*);

*uint32\_t*\

**fido\_cred\_sigcount**(*const fido\_cred\_t \*cred*);

## DESCRIPTION

FIDO2 credentials are abstracted in *libfido2* by the *fido\_cred\_t* type. The functions described in this page allow a *fido\_cred\_t* type to be allocated, deallocated, and inspected. For other operations on *fido\_cred\_t*, please refer to [fido\_cred\_set\_authdata(3)](/fido_cred_set_authdata/3.md), [fido\_cred\_exclude(3)](/fido_cred_exclude/3.md), [fido\_cred\_verify(3)](/fido_cred_verify/3.md), and [fido\_dev\_make\_cred(3)](/fido_dev_make_cred/3.md).

The **fido\_cred\_new**() function returns a pointer to a newly allocated, empty *fido\_cred\_t* type. If memory cannot be allocated, NULL is returned.

The **fido\_cred\_free**() function releases the memory backing *\*cred\_p*, where *\*cred\_p* must have been previously allocated by **fido\_cred\_new**(). On return, *\*cred\_p* is set to NULL. Either *cred\_p* or *\*cred\_p* may be NULL, in which case **fido\_cred\_free**() is a NOP.

If the CTAP 2.2 FIDO\_EXT\_PAYMENT extension is enabled on *cred*, then the **fido\_cred\_payment**() function returns true. Since the extension has no output, the **fido\_cred\_payment**() function is only useful if *cred* was retrieved via [fido\_credman\_rk(3)](/fido_credman_rk/3.md).

If the CTAP 2.1 FIDO\_EXT\_MINPINLEN extension is enabled on *cred*, then the **fido\_cred\_pin\_minlen**() function returns the minimum PIN length of *cred*. Otherwise, **fido\_cred\_pin\_minlen**() returns zero. See [fido\_cred\_set\_pin\_minlen(3)](/fido_cred_set_pin_minlen/3.md) on how to enable this extension.

If the CTAP 2.1 FIDO\_EXT\_CRED\_PROTECT extension is enabled on *cred*, then the **fido\_cred\_prot**() function returns the protection of *cred*. Otherwise, **fido\_cred\_prot**() returns zero. See [fido\_cred\_set\_prot(3)](/fido_cred_set_prot/3.md) for the protection policies understood by *libfido2*.

The **fido\_cred\_fmt**() function returns a pointer to a NUL-terminated string containing the attestation statement format identifier of *cred*, or NULL if *cred* does not have a format set.

The **fido\_cred\_rp\_id**(), **fido\_cred\_rp\_name**(), **fido\_cred\_user\_name**(), and **fido\_cred\_display\_name**() functions return pointers to NUL-terminated strings holding the relying party ID, relying party name, user name, and user display name attributes of *cred*, or NULL if the respective entry is not set.

The **fido\_cred\_authdata\_ptr**(), **fido\_cred\_authdata\_raw\_ptr**(), **fido\_cred\_clientdata\_hash\_ptr**(), **fido\_cred\_id\_ptr**(), **fido\_cred\_aaguid\_ptr**(), **fido\_cred\_largeblob\_key\_ptr**(), **fido\_cred\_pubkey\_ptr**(), **fido\_cred\_sig\_ptr**(), **fido\_cred\_user\_id\_ptr**(), **fido\_cred\_x5c\_ptr**(), and **fido\_cred\_attstmt\_ptr**() functions return pointers to the CBOR-encoded and raw authenticator data, client data hash, ID, authenticator attestation GUID, “largeBlobKey”, public key, signature, user ID, x509 leaf certificate, and attestation statement parts of *cred*, or NULL if the respective entry is not set.

The **fido\_cred\_hmac\_secret\_ptr**() function returns a pointer to the hmac-secret attribute of *cred*. The HMAC Secret MC Extension (hmac-secret-mc) is a CTAP 2.2 extension. Note that the resulting hmac-secret varies according to whether user verification was performed by the authenticator.

The **fido\_cred\_authdata\_len**(), **fido\_cred\_authdata\_raw\_len**(), **fido\_cred\_clientdata\_hash\_len**(), **fido\_cred\_id\_len**(), **fido\_cred\_aaguid\_len**(), **fido\_cred\_hmac\_secret\_len**(), **fido\_cred\_largeblob\_key\_len**(), **fido\_cred\_pubkey\_len**(), **fido\_cred\_sig\_len**(), **fido\_cred\_user\_id\_len**(), **fido\_cred\_x5c\_len**(), and **fido\_cred\_attstmt\_len**() functions return the length of the given attribute.

The **fido\_cred\_x5c\_list\_count**() function returns the length of the x509 certificate chain in *cred* and the **fido\_cred\_x5c\_list\_ptr**() and **fido\_cred\_x5c\_list\_len**() functions return a pointer to and length of the x509 certificate at index *idx* respectively. Please note that the leaf certificate has an *idx* (index) value of 0 and calling **fido\_cred\_x5c\_list\_ptr**(*cred*, *0*) and **fido\_cred\_x5c\_list\_len**(*cred*, *0*) is equivalent to **fido\_cred\_x5c\_ptr**(*cred*) and **fido\_cred\_x5c\_len**(*cred*) respectively. If *idx* exceeds the return value of **fido\_cred\_x5c\_list\_count**(), **fido\_cred\_x5c\_list\_ptr**() returns NULL and **fido\_cred\_x5c\_list\_len**() returns 0.

The authenticator data, x509 certificate, and signature parts of a credential are typically passed to a FIDO2 server for verification.

The **fido\_cred\_entattest**() function returns true if an enterprise attestation was returned for *cred*.

The **fido\_cred\_type**() function returns the COSE algorithm of *cred*.

The **fido\_cred\_flags**() function returns the authenticator data flags of *cred*.

The **fido\_cred\_sigcount**() function returns the authenticator data signature counter of *cred*.

## RETURN VALUES

The authenticator data returned by **fido\_cred\_authdata\_ptr**() is a CBOR-encoded byte string, as obtained from the authenticator. To obtain the decoded byte string, use **fido\_cred\_authdata\_raw\_ptr**().

If not NULL, pointers returned by **fido\_cred\_fmt**(), **fido\_cred\_authdata\_ptr**(), **fido\_cred\_clientdata\_hash\_ptr**(), **fido\_cred\_id\_ptr**(), **fido\_cred\_aaguid\_ptr**(), **fido\_cred\_largeblob\_key\_ptr**(), **fido\_cred\_pubkey\_ptr**(), **fido\_cred\_sig\_ptr**(), and **fido\_cred\_x5c\_ptr**() are guaranteed to exist until any API function that takes *cred* without the *const* qualifier is invoked.

## SEE ALSO

[fido\_cred\_exclude(3)](/fido_cred_exclude/3.md), [fido\_cred\_set\_authdata(3)](/fido_cred_set_authdata/3.md), [fido\_cred\_set\_pin\_minlen(3)](/fido_cred_set_pin_minlen/3.md), [fido\_cred\_set\_prot(3)](/fido_cred_set_prot/3.md), [fido\_cred\_verify(3)](/fido_cred_verify/3.md), [fido\_credman\_metadata\_new(3)](/fido_credman_metadata_new/3.md), [fido\_credman\_rk(3)](/fido_credman_rk/3.md), [fido\_dev\_largeblob\_get(3)](/fido_dev_largeblob_get/3.md), [fido\_dev\_make\_cred(3)](/fido_dev_make_cred/3.md)
