---
name: "nvme_gen_dhchap_key"
section: "2"
platform: "linux"
package: "libnvme-dev"
version: "1.13-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/nvme_gen_dhchap_key"
---

# nvme\_gen\_dhchap\_key(2)

DH-HMAC-CHAP key generation

## NAME

nvme\_gen\_dhchap\_key - DH-HMAC-CHAP key generation

## SYNOPSIS

**int nvme\_gen\_dhchap\_key** **(char \*hostnqn** *,* **enum nvme\_hmac\_alg hmac** *,* **unsigned int key\_len** *,* **unsigned char \*secret** *,* **unsigned char \*key** *);*

## ARGUMENTS

- hostnqn

  Host NVMe Qualified Name

- hmac

  HMAC algorithm

- key\_len

  Output key length

- secret

  Secret to used for digest

- key

  Generated DH-HMAC-CHAP key

## RETURN

If key generation was successful the function returns 0 or -1 with errno set otherwise.
