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

# nvme\_insert\_tls\_key(2)

Derive and insert TLS key

## NAME

nvme\_insert\_tls\_key - Derive and insert TLS key

## SYNOPSIS

**long nvme\_insert\_tls\_key** **(const char \*keyring** *,* **const char \*key\_type** *,* **const char \*hostnqn** *,* **const char \*subsysnqn** *,* **int hmac** *,* **unsigned char \*configured\_key** *,* **int key\_len** *);*

## ARGUMENTS

- keyring

  Keyring to use

- key\_type

  Type of the resulting key

- hostnqn

  Host NVMe Qualified Name

- subsysnqn

  Subsystem NVMe Qualified Name

- hmac

  HMAC algorithm

- configured\_key

  Configured key data to derive the key from

- key\_len

  Length of *configured\_key*

## DESCRIPTION

Derives a 'retained' TLS key as specified in NVMe TCP 1.0a and stores it as type *key\_type* in the keyring specified by *keyring*.

## RETURN

The key serial number if the key could be inserted into the keyring or 0 with errno otherwise.
