NVME-KEYS-GEN-TLS(1)
β¨ NVME-KEYS-GEN-TLS(1) β¨
okay bestie, this is a page from the NVMe Manual and it's literally called nvme-keys-gen-tls-psk β yes, the filename up top and the NAME line are doing a little name-shuffle thing, don't worry about it, it's the same command π
πΈ NAME πΈ
nvme-keys-gen-tls-psk β generate a NVMe TLS PSK. that's it. that's the whole vibe. π
π¦ SYNOPSIS π¦
nvme [<global-options>] keys gen-tls-psk [--keyring=<name> | -k <name>]
[--keytype=<type> | -t <type>]
[--hostnqn=<nqn> | -n <nqn>]
[--subsysnqn=<nqn> | -c <nqn>]
[--hmac=<hmac-id> | -m <hmac-id>]
[--identity=<id-vers> | -I <id-vers>]
[--secret=<secret> | -s <secret>]
[--insert | -i]
[--compat | -C]
[--keyfile=<keyfile> | -f <keyfile>]
like, yes, that's a lot of brackets. she's thorough. π
π DESCRIPTION π
So what this does: it generates a NVMe TLS configured PSK and prints it in the PSK interchange format, which looks like this, exactly:
NVMeTLSkey-1:<hmac>:<base64 encoded data>:
iconic format. no notes. β¨
Now the juicy part β if you pass the --insert option, a retained PSK is additionally derived from the configured PSK and the host NQN, using the HKDF-Expand-Label algorithm from RFC 8446, the TLS PSK is derived from it, and that gets stored in the specified keyring under an identity computed from the host NQN and the subsystem NQN:
NVMe0R<hmac> <host NQN> <subsystem NQN>β for identity version 0NVMe1R<hmac> <host NQN> <subsystem NQN> <PSK digest>β for identity version 1
π«Ά heads up bestie: once the TLS PSK is stored in the keyring, the configured PSK it was derived from cannot be retrieved from the keyring. gone. poof. no take-backs. π
Speaking of little traps β the diagnostics that validate --secret are printed to stdout rather than stderr. like, why? mysterious. but true. Most of them accompany a non-zero exit, but Skipping excess secret bytes does not: an over-long --secret still exits 0, with the warning sitting ahead of the key, so a script reading the key off stdout gets the warning instead. π so if you're parsing stdout, be aware, okay? be aware.
And both NQNs are inputs to the TLS PSK itself, not just to the identity it's stored under:
- the host NQN through the retained PSK derivation
- both NQNs again through the identity (identity version 0) or the PSK digest it embeds (identity version 1), which is the context of the TLS PSK derivation
both. of. them. it's giving thorough. π₯
π OPTIONS π
-k<name>,--keyring=<name>β Name of the keyring into which the TLS PSK should be stored. Default is.nvme.-t<type>,--keytype=<type>β Type of the key under which the TLS PSK is stored. Default ispsk.-n<nqn>,--hostnqn=<nqn>β Host NVMe Qualified Name (NQN) to be used for the retained PSK derivation and for the identity the TLS PSK is stored under. Defaults to the host NQN of the system, read from/etc/nvme/hostnqnor, if that file does not exist, generated from the host ID.-c<nqn>,--subsysnqn=<nqn>β Subsystem NVMe Qualified Name (NQN) to be used for the identity the TLS PSK is stored under. Required with--insert. β οΈ-m<hmac-id>,--hmac=<hmac-id>β Select the hash function. It derives the retained PSK and identifies the TLS 1.3 cipher suite the TLS PSK is bound to, so it is recorded both in the PSK interchange format and in the TLS PSK identity, written as two digits (<hmac>above). Possible values:1β SHA-256 (default)2β SHA-384
-I<id-vers>,--identity=<id-vers>β Select the TLS PSK identity version of the identity the TLS PSK is stored under. Possible values:0β Obsolete (default); defined in the NVMe TCP Transport Specification 1.0 π¬1β TLS 1.3 with the PSK digest in the TLS PSK identity
-s<secret>,--secret=<secret>β Configured PSK (in hexadecimal) to be used. If none are provided a random value is used. π²-i,--insertβ Additionally derive a retained PSK and, from that, the TLS PSK, and insert the TLS PSK into the keyring. The configured PSK is printed in PSK interchange format either way.-C,--compatβ Use the original non-RFC 8446 compliant algorithm when deriving the retained PSK and the TLS PSK, for compatibility with older implementations.-f<keyfile>,--keyfile=<keyfile>β Append the identity of the TLS PSK, and the TLS PSK itself in PSK interchange format, tokeyfile. Ignored without--insert, which is what derives the TLS PSK. π
π GLOBAL OPTIONS π
these are the big-girl options defined at the top-level nvme command, and they're available to this subcommand too. main character energy, honestly. π
--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<fmt>,--output-format=<fmt>β Set the reporting format tonormal,tabular,'json, orbinary. Only one output format may be used at a time.--output-format-version=<version>β Select the output format version. Version1uses the original field naming, while version2(default) provides more consistent and script-friendly field names. Other versions are rejected. π«--quietβ Suppress informational messages. Errors are still reported, and--quietcancels any--verbosefor the library log level.--set-options=<key=value>[,<key=value>...]β Set libnvme library options for this invocation. Supported keys areforce-4k,mi-probe-enabled,test-base-dirandtest-sysfs-dir.--timeout=<ms>β Set the timeout for the command in milliseconds.infiniteor-1waits without a time limit (0xffffffff).-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). A command-line flag always overrides the file. periodt. π
β EXAMPLES β
No Examples
yeah. that's literally what it says. not one single example. we're on our own, bestie. π lowkey rude but okay.
π§ NVME π§
Part of the nvme-user suite. πΈ
and that's the whole page, bestie! slay π this gem comes to you from the NVMe source, dated 10/30/2026 β screenshot it, frame it, put it on your wall, iykyk π«Άβ¨
π¦ where this page comes from
- arch rolling: nvme-cli 3.2-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms