nvme_import_tls_key(2)

πŸ’– nvme_import_tls_key β€” the libnvme API manual, bestie edition ✨

okay so hi bestie!! 🫢 welcome to nvme_import_tls_key(2) from the libnvme API manual. this is the one that takes your cute little encoded TLS key and turns it into the actual raw bytes your code can use. it's giving "glow up but for key material" πŸ’…


🌸 NAME 🌸

nvme_import_tls_key β€” import a TLS key πŸ”‘


✨ SYNOPSIS ✨

unsigned char * nvme_import_tls_key (const char *encoded_key , int
*key_len , unsigned int *hmac );

like yes, that's the whole signature, no cap. πŸ“œ


πŸŽ€ ARGUMENTS πŸŽ€

  • encoded_key β€” the TLS key, but in PSK interchange format. that's the text-y version, not the raw bytes yet πŸ¦‹
  • key_len β€” this is where the length of the resulting key data goes. output girlie, she reports back πŸ“
  • hmac β€” the HMAC algorithm. which flavor of HMAC we're dealing with πŸ”

🧚 DESCRIPTION 🧚

so basically this function imports key_data in the PSK Interchange format β€” and the lore for that format is defined in section 3.6.1.5 of the NVMe TCP Transport specification πŸ“–βœ¨. that spec is the source of truth, we do not freestyle it, periodt.

you hand it the interchange-format key, it hands you back the raw key data. the way that encoding works is literally spelled out in the spec so go read that section if you're curious, iykyk πŸ’œ


πŸ‘‘ RETURN πŸ‘‘

it returns the raw data of the PSK 🌈 β€” or NULL with errno set if something went wrong 😭 (yes, errno, the classic).

⚠️ heads up bestie: it is the responsibility of the caller to free the returned string. that memory is yours now. don't ghost it, free() it. fr fr.

πŸ¦‹ SEE ALSO πŸ¦‹

there's no SEE ALSO section in this one β€” it's a short queen, she said what she said πŸ’…


<div>okay bye ily, this page was brought to you by libnvme and the fine folks who dated it July 2026 🌸✨ mwah, go free your strings πŸŽ€πŸ«Ά</div>

πŸ“¦ where this page comes from