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

# [NAME](#NAME)

libnvmf\_import\_tls\_key\_versioned - Decode a PSK from the PSK interchange format

# [SYNOPSIS](#SYNOPSIS)

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

# [ARGUMENTS](#ARGUMENTS)

[ctx](#ctx)

struct libnvme\_global\_ctx object

[encoded\_key](#encoded_key)

PSK in PSK interchange format

[version](#version)

Version of the PSK interchange format read from *encoded\_key* to return. Always 1; any other value is rejected with -EINVAL.

[hmac](#hmac)

Hash function recorded in *encoded\_key* to return; it derives a retained PSK from a configured PSK

[key\_len](#key_len)

Length of the decoded PSK to return

[key](#key)

Decoded PSK to return

# [DESCRIPTION](#DESCRIPTION)

Decodes *encoded\_key* from 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 buffer.

# [RETURN](#RETURN)

0 on success, negative error code otherwise.

libnvmf\_import\_tls\_key\_versioned October 2026

---

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