libnvmf_export_tls_key(9)

πŸ“¦ version 3.2, in arch rolling

πŸ’… libnvmf_export_tls_key(9) β€” the libnvme API manual, bestie edition πŸŽ€

okay so picture this: you're deep in the libnvme API manual (yes that's the whole vibe of this page, we're in the libnvme API manual ✨) and you need to get a raw PSK out into the world looking all fancy. That's literally this function. Let's go 🫢


✨ NAME ✨

libnvmf_export_tls_key β€” encode a PSK in the PSK interchange format πŸ’–


🌸 SYNOPSIS 🌸

int libnvmf_export_tls_key (struct libnvme_global_ctx *ctx , const
       unsigned char *key_data , int key_len , char **encoded_keyp );

like, that's the whole signature, copied exactly, no notes 😌


πŸ¦‹ ARGUMENTS πŸ¦‹

  • ctx β€” your struct libnvme_global_ctx object, the context baddie that holds it all together πŸ’œ
  • key_data β€” the raw PSK data, straight up, no filter πŸ”₯
  • key_len β€” the length of key_data, obviously, gotta know how much of the good stuff there is ⭐
  • encoded_keyp β€” the encoded PSK to return, i.e. where the glow-up lands πŸ‘‘

🧚 DESCRIPTION 🧚

so this one returns key_data in the PSK Interchange format as defined in section 3.6.1.5 of the NVMe TCP Transport Specification 1.3. That's the spec, that's the section, that's the version β€” no cap, no guessing πŸ’…βœ¨

⚠️ heads up bestie: it is the responsibility of the caller to free the returned string. That's you. Not the function. You. Free it. Don't leave it hanging or it's giving memory leak 😭

🌈 RETURN 🌈

  • 0 on success πŸŽ‰
  • a negative error code otherwise πŸ’€

that's it, that's the page πŸ“ go forth and encode your PSKs, icon behavior only πŸ‘‘πŸ’–

signed off by the libnvme API manual, version libnvmf_export_tls_key, dated October 2026 β€” mwah, ily, bye πŸ«ΆπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from