libnvmf\_generate\_tls\_key\_identity(9) libnvme API manual libnvmf\_generate\_tls\_key\_identity(9)

# [NAME](#NAME)

libnvmf\_generate\_tls\_key\_identity - Generate the TLS PSK identity

# [SYNOPSIS](#SYNOPSIS)

**int libnvmf\_generate\_tls\_key\_identity** **(struct libnvme\_global\_ctx \*ctx ,** **const char \*hostnqn ,** **const char \*subsysnqn ,** **int version ,** **enum libnvmf\_hmac\_alg hmac ,** **unsigned char \*configured\_key ,** **int key\_len ,** **char \*\*identity );**

# [ARGUMENTS](#ARGUMENTS)

[ctx](#ctx)

struct libnvme\_global\_ctx object

[hostnqn](#hostnqn)

Host NVMe Qualified Name

[subsysnqn](#subsysnqn)

Subsystem NVMe Qualified Name

[version](#version)

TLS PSK identity version to use

[hmac](#hmac)

HMAC algorithm

[configured\_key](#configured_key)

Configured PSK to derive the retained PSK from

[key\_len](#key_len)

Length of *configured\_key*

[identity](#identity)

TLS PSK identity to return

# [DESCRIPTION](#DESCRIPTION)

Derives a retained PSK as specified in the NVMe TCP Transport Specification 1.3, section 3.6.1.3, and generates the corresponding TLS PSK identity.

It is the responsibility of the caller to free the returned string.

# [RETURN](#RETURN)

0 on success, negative error code otherwise.

libnvmf\_generate\_tls\_key\_identity October 2026

---

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