LIBNVMF_EXPORT_TLS_KEY_VERSIONED-LIBNVME3(2)

πŸ“¦ version 3.2, in arch rolling

πŸŽ€ libnvmf_export_tls_key_versioned(9) πŸŽ€

okay bestie, so this is a page straight outta the libnvme API manual, and honestly? it's a little function with main character energy. it does exactly one thing and it slays at it: takes your raw pre-shared key and wraps it up all pretty in the PSK interchange format. let's get into it πŸ’…


✨ SYNOPSIS ✨

int libnvmf_export_tls_key_versioned (struct libnvme_global_ctx *ctx ,
unsigned char version , enum libnvmf_hmac_alg hmac , const unsigned char
*key_data , size_t key_len , char **encoded_keyp );

like, that's the whole vibe. six args, one int coming back. easy. 🫢


🌸 ARGUMENTS 🌸

  • ctx β€” the struct libnvme_global_ctx object. your context girlie. it's giving "everything needs a handle."
  • version β€” which version of the PSK interchange format you wanna write. the spec defines 1, and it shows up in the encoded string as the digit right after "NVMeTLSkey-". so yeah, that little digit is not decoration, it's the version, iykyk ⭐
  • hmac β€” the hash function that gets recorded in the encoded PSK. it's the thing you use to derive a retained PSK from a configured PSK. lowkey important.
  • key_data β€” the raw PSK data. the real one. the OG. πŸ”₯
  • key_len β€” how long key_data is. size matters, respectfully. πŸ’€
  • encoded_keyp β€” where the encoded PSK gets returned. it's a char **, so you're getting a pointer back through a pointer. iconic levels of indirection ngl.

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it actually do? it returns key_data in the PSK Interchange format, exactly as defined in section 3.6.1.5 of the NVMe TCP Transport Specification 1.3. no cap, that's the reference, go read it if you want the lore.

⚠️ heads up bestie: it is the responsibility of the caller to free the returned string. not me, not the function β€” you. so don't just vibe and forget, or that's a leak and we don't do leaks in this house πŸ™ˆ

πŸ‘‘ RETURN πŸ‘‘

  • 0 on success β€” slay ✨
  • negative error code otherwise β€” not slay, check your args 😭

and that's the whole page, bestie! πŸ’– go encode some keys, free your strings, and remember: the version digit after "NVMeTLSkey-" is literally right there, you got this 🧚


mwah πŸ’‹ β€” written from the libnvme API manual, dated October 2026. stay encoded, stay iconic. πŸ“

πŸ“¦ where this page comes from