libnvmf_insert_tls_key(9)

πŸ“¦ version 3.2, in arch rolling

πŸ’… libnvmf_insert_tls_key

okay so this is a page from the libnvme API manual, and bestie, it's about deriving a TLS PSK and shoving it into a keyring. Yes, actual crypto plumbing. You're gonna do great 🫢


✨ NAME ✨

libnvmf_insert_tls_key β€” derive and insert a TLS PSK. that's the whole vibe. derive it, insert it, done πŸ’…


🌸 SYNOPSIS 🌸

int libnvmf_insert_tls_key (struct libnvme_global_ctx *ctx , const char
*keyring , const char *key_type , const char *hostnqn , const char
*subsysnqn , enum libnvmf_hmac_alg hmac , unsigned char *configured_key
, int key_len , long *key );

nine arguments. NINE. she's high-maintenance but she delivers ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • ctx β€” the struct libnvme_global_ctx object. your whole context, your main character 🌈
  • keyring β€” the keyring to use. that's where the key's gonna live 🏠
  • key_type β€” the type of the resulting key. yes it matters, no you can't skip it
  • hostnqn β€” Host NVMe Qualified Name πŸ¦‹
  • subsysnqn β€” Subsystem NVMe Qualified Name πŸ¦‹
  • hmac β€” the HMAC algorithm. it's an enum libnvmf_hmac_alg btw
  • configured_key β€” the configured PSK you're deriving the retained PSK from. origin story energy πŸ’œ
  • key_len β€” length of configured_key. obviously. she needs to know how big you are
  • key β€” key serial to return, like a little receipt 🧾

πŸ”₯ DESCRIPTION πŸ”₯

so here's the lore. this function derives a retained PSK from configured_key, and then from that it gets the TLS PSK and its identity β€” using identity version 0 β€” exactly as specified in the NVMe TCP Transport Specification 1.0, section 3.6.1.3. no cap, that's the spec reference, write it down πŸ“

then it stores the TLS PSK as type key_type under that identity, in the keyring you passed as keyring. iconic. she does the whole thing for you πŸŽ€

⚠️ but listen β€” the NVMe TCP Transport Specification 1.3 marks identity version 0 as obsolete. so like… it's giving deprecated. if you actually want to pick your identity version, use libnvmf_insert_tls_key_versioned instead. she's the upgrade πŸ’…

⭐ RETURN ⭐

0 on success, negative error code otherwise. that's it. zero is the slay, anything negative is the 😭


okay that's the whole page, bestie, you ate πŸ’–

this little manual moment was brought to you by October 2026, the libnvme API manual, and libnvmf_insert_tls_key(9) β€” go forth and derive responsibly βœ¨πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from