---
name: "nvme_read_key"
section: "2"
platform: "linux"
package: "libnvme-dev"
version: "1.13-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/nvme_read_key"
---

# nvme\_read\_key(2)

Read key raw data

## NAME

nvme\_read\_key - Read key raw data

## SYNOPSIS

**unsigned char \* nvme\_read\_key** **(long keyring\_id** *,* **long key\_id** *,* **int \*len** *);*

## ARGUMENTS

- keyring\_id

  Id of the keyring holding key\_id

- key\_id

  Key id

- len

  Length of the returned data

## DESCRIPTION

Links the keyring specified by *keyring\_id* into the session keyring and reads the payload of the key specified by *key\_id*. *len* holds the size of the returned buffer. If *keyring* is 0 the default keyring '.nvme' is used.

## RETURN

Pointer to the payload on success, or NULL with errno set otherwise.
