LIBNVMF_EXPORT_TLS_KEY_VERSIONED-LIBNVME3(2)
π 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β thestruct libnvme_global_ctxobject. your context girlie. it's giving "everything needs a handle."versionβ which version of the PSK interchange format you wanna write. the spec defines1, 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 longkey_datais. size matters, respectfully. πencoded_keypβ where the encoded PSK gets returned. it's achar **, 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 π
0on 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
- 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