NVME-KEYS-IMPORT(1) NVMe Manual NVME-KEYS-IMPORT(1)

# [NAME](#NAME)

nvme-keys-import - Import NVMeoF TLS PSKs or KX-HMAC-CHAP secrets into a keyring

# [SYNOPSIS](#SYNOPSIS)

```
nvme [<global-options>] keys import [--keyring=<name> | -k <name>]


                        [--keyfile=<file> | -f <file>]


                        [--keydata=<key> | -d <key>]


                        [--identity=<identity> | -i <identity>]
```

# [DESCRIPTION](#DESCRIPTION)

Imports one or more already-identified keys into a keyring. The key type (NVMe TLS PSK or KX-HMAC-CHAP host secret) is auto-detected from the key’s prefix (*NVMeTLSkey-1:* or *DHHC-1:*).

Without *--identity*, keys are read in bulk. Key data is read in the form

&lt;description&gt; &lt;key&gt;

where *&lt;description&gt;* is the key description — the TLS PSK identity for a TLS PSK — and *&lt;key&gt;* is either a TLS PSK in interchange format *NVMeTLSkey-1:&lt;hmac&gt;:&lt;base64 encoded data&gt;:* or a KX-HMAC-CHAP secret in the form *DHHC-1:&lt;hmac&gt;:&lt;base64 encoded data&gt;:*, one key per line, and imported into the kernel keyring. This is the format produced by [**nvme-keys-export**(1)](/man/os/nvme-cli/nvme-keys-export.1).

With *--identity*, a single key is imported instead: the key is read from *--keydata* (or, if not given, from stdin) and stored under the given identity. This is the way to insert a single KX-HMAC-CHAP secret, or a previously derived TLS PSK, directly by identity, without needing a keyfile.

Note that this command does not derive a TLS PSK from a configured PSK, nor compute the identity to store it under from a host/subsystem NQN pair; use [**nvme-keys-insert-tls-psk**(1)](/man/os/nvme-cli/nvme-keys-insert-tls-psk.1) for that.

# [OPTIONS](#OPTIONS)

-k &lt;name&gt;, --keyring=&lt;name&gt;

Name of the keyring to import the keys into. Default is *.nvme*.

-f &lt;file&gt;, --keyfile=&lt;file&gt;

File to read the keys from instead of stdin. Only used in bulk mode (i.e. when *--identity* is not given).

-d &lt;key&gt;, --keydata=&lt;key&gt;

Key to be inserted when *--identity* is given. If not given, the key is read from stdin.

-i &lt;identity&gt;, --identity=&lt;identity&gt;

Identity to store a single key under. If given, *--keydata* (or stdin) is read as a single key instead of a bulk &lt;description&gt; &lt;key&gt; list.

# [GLOBAL OPTIONS](#GLOBAL_OPTIONS)

The following options are defined at the top-level nvme command and are available to this subcommand:

--dry-run

Print the command that would be executed, but do not actually execute it.

--no-ioctl-probing

Disable probing for 64-bit IOCTL support.

--no-retries

Disable retry logic on transient errors.

-o &lt;fmt&gt;, --output-format=&lt;fmt&gt;

Set the reporting format to *normal*, *tabular, 'json*, or *binary*. Only one output format may be used at a time.

--output-format-version=&lt;version&gt;

Select the output format version. Version *1* uses the original field naming, while version *2* (default) provides more consistent and script-friendly field names.

--timeout=&lt;ms&gt;

Set the timeout for the command in milliseconds.

-v, --verbose

Increase the level of detail in the output. May be specified multiple times to further increase verbosity.

These options can also be set as machine-wide defaults in [nvme-cli.conf(5)](/man/os/nvme-cli/nvme-cli.conf.5). A command-line flag always overrides the file.

# [EXAMPLES](#EXAMPLES)

•Import previously exported keys from a file and verify with keyctl

```
# nvme keys import -f nvme-tls-keys.txt
# keyctl show
Session Keyring


 573249525 --alswrv      0     0  keyring: _ses


 353599402 --alswrv      0 65534   \_ keyring: _uid.0


 475911922 ---lswrv      0     0   \_ keyring: .nvme


 734343968 --als-rv      0     0       \_ psk: NVMe0R01 hostnqn0 subsys0
```

•Import a single KX-HMAC-CHAP secret under an explicit identity

```
# nvme keys import -i host2 -d DHHC-1:00:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n:
```

# [NVME](#NVME)

Part of the nvme-user suite

09/18/2026 NVMe

---

Document: nvme-keys-import(1) from nvme-cli 3.1-r1 (Chainguard OS)
Source: https://github.com/linux-nvme/nvme-cli
