libnvmf\_export\_tls\_key\_versioned(9) libnvme API manual libnvmf\_export\_tls\_key\_versioned(9)

# [NAME](#NAME)

libnvmf\_export\_tls\_key\_versioned - Encode a PSK in the PSK interchange format

# [SYNOPSIS](#SYNOPSIS)

**int libnvmf\_export\_tls\_key\_versioned** **(struct libnvme\_global\_ctx \*ctx ,** **unsigned char version ,** **enum libnvmf\_hmac\_alg hmac ,** **const unsigned char \*key\_data ,** **size\_t key\_len ,** **char \*\*encoded\_keyp );**

# [ARGUMENTS](#ARGUMENTS)

[ctx](#ctx)

struct libnvme\_global\_ctx object

[version](#version)

Version of the PSK interchange format to write. The specification defines 1, which appears in the encoded string as the digit after "NVMeTLSkey-".

[hmac](#hmac)

Hash function recorded in the encoded PSK, used to derive a retained PSK from a configured PSK

[key\_data](#key_data)

Raw PSK data

[key\_len](#key_len)

Length of *key\_data*

[encoded\_keyp](#encoded_keyp)

Encoded PSK to return

# [DESCRIPTION](#DESCRIPTION)

Returns *key\_data* in the PSK Interchange format as defined in section 3.6.1.5 of the NVMe TCP Transport Specification 1.3.

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

# [RETURN](#RETURN)

0 on success, negative error code otherwise.

libnvmf\_export\_tls\_key\_versioned October 2026

---

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