libnvmf\_insert\_tls\_key(9) libnvme API manual libnvmf\_insert\_tls\_key(9)

# [NAME](#NAME)

libnvmf\_insert\_tls\_key - Derive and insert a TLS PSK

# [SYNOPSIS](#SYNOPSIS)

**int libnvmf\_insert\_tls\_key** **(struct libnvme\_global\_ctx \*ctx ,** **const char \*keyring ,** **const char \*key\_type ,** **const char \*hostnqn ,** **const char \*subsysnqn ,** **enum libnvmf\_hmac\_alg hmac ,** **unsigned char \*configured\_key ,** **int key\_len ,** **long \*key );**

# [ARGUMENTS](#ARGUMENTS)

[ctx](#ctx)

struct libnvme\_global\_ctx object

[keyring](#keyring)

Keyring to use

[key\_type](#key_type)

Type of the resulting key

[hostnqn](#hostnqn)

Host NVMe Qualified Name

[subsysnqn](#subsysnqn)

Subsystem NVMe Qualified Name

[hmac](#hmac)

HMAC algorithm

[configured\_key](#configured_key)

Configured PSK to derive the retained PSK from

[key\_len](#key_len)

Length of *configured\_key*

[key](#key)

Key serial to return

# [DESCRIPTION](#DESCRIPTION)

Derives a retained PSK from *configured\_key* and, from that, the TLS PSK and its identity, using identity version 0, as specified in the NVMe TCP Transport Specification 1.0, section 3.6.1.3. Stores the TLS PSK as type *key\_type* under that identity in the keyring specified by *keyring*.

The NVMe TCP Transport Specification 1.3 marks identity version 0 obsolete. Use **libnvmf\_insert\_tls\_key\_versioned** to select the identity version.

# [RETURN](#RETURN)

0 on success, negative error code otherwise.

libnvmf\_insert\_tls\_key October 2026

---

Document: libnvmf_insert_tls_key-libnvme3(2) from nvme-cli 3.2-r0 (Chainguard OS)
Source: https://github.com/linux-nvme/nvme-cli
