---
name: "libnvmf_export_tls_key-libnvme3"
section: "2"
platform: "linux"
package: "nvme-cli"
version: "3.2-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libnvmf_export_tls_key-libnvme3"
---

# libnvmf\_export\_tls\_key-libnvme3(2)

Encode a PSK in the PSK interchange format

## NAME

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

## SYNOPSIS

**int libnvmf\_export\_tls\_key** **(struct libnvme\_global\_ctx \*ctx** *,* **const unsigned char \*key\_data** *,* **int key\_len** *,* **char \*\*encoded\_keyp** *);*

## ARGUMENTS

- ctx

  struct libnvme\_global\_ctx object

- key\_data

  Raw PSK data

- key\_len

  Length of *key\_data*

- encoded\_keyp

  Encoded PSK to return

## 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

0 on success, negative error code otherwise.
