libnvmf\_create\_raw\_secret(9) libnvme API manual libnvmf\_create\_raw\_secret(9)

# [NAME](#NAME)

libnvmf\_create\_raw\_secret - Generate a raw secret buffer from input data

# [SYNOPSIS](#SYNOPSIS)

**int libnvmf\_create\_raw\_secret** **(struct libnvme\_global\_ctx \*ctx ,** **const char \*secret ,** **size\_t key\_len ,** **unsigned char \*\*raw\_secret );**

# [ARGUMENTS](#ARGUMENTS)

[ctx](#ctx)

struct libnvme\_global\_ctx object

[secret](#secret)

Input secret data

[key\_len](#key_len)

The length of the raw\_secret in bytes

[raw\_secret](#raw_secret)

Return buffer with the generated raw secret

# [DESCRIPTION](#DESCRIPTION)

Transforms the provided *secret* into a raw secret buffer suitable for use with NVMe key management operations.

The generated raw secret can subsequently be passed to **libnvmf\_insert\_tls\_key\_versioned** or **libnvmf\_update\_key**.

# [RETURN](#RETURN)

0 on success, negative error code otherwise.

libnvmf\_create\_raw\_secret October 2026

---

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