Tspi_Key_UnloadKey(3)

πŸ’– Tspi_Key_UnloadKey β€” a manual page, but make it cute πŸ’–

okay bestie, so this one lives in the Library Functions Manual of the TCG Software Stack Developer's Reference, and it's the Tspi_Key_UnloadKey(3) page β€” aka the "ok girl, we're done here, get out of the TPM" function. 🫢


✨ NAME ✨

Tspi_Key_UnloadKey β€” unload a key from the TPM

no cap, that's literally it. one job. iconic behavior. πŸ’…


🌸 SYNOPSIS 🌸

first things first, you gotta pull in the whole header squad. all of them. yes, all seven. don't skip, that's not the vibe:

#include <tss/platform.h>
#include <tss/tcpa_defines.h>
#include <tss/tcpa_typedef.h>
#include <tss/tcpa_struct.h>
#include <tss/tss_typedef.h>
#include <tss/tss_structs.h>
#include <tss/tspi.h>

TSS_RESULT Tspi_Key_UnloadKey(TSS_HKEY hKey);

so like, the function itself takes exactly one (1) handle and gives you back a TSS_RESULT. simple. clean. we love a low-maintenance signature. 😌


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• β€” Tspi_Key_UnloadKey unloads the key that's referenced by the given key object, from the TPM. it's giving "pack your bags, you're leaving the building."

and the way this actually goes down? this call will result in a TPM_EvictKey operation for the specified key. so the TPM is the one doing the eviction, and your key is the one getting evicted. dramatic? maybe. necessary? absolutely. πŸ’€


πŸŽ€ PARAMETERS πŸŽ€

hKey

the hKey parameter is the handle of the key object to unload. that's the one (1) thing you gotta hand over. that's it. that's the whole ask. πŸ“


πŸ‘‘ RETURN CODES πŸ‘‘

Tspi_Key_UnloadKey returns TSS_SUCCESS on success β€” slay β€” otherwise one of the following values gets returned at you:

  • TSS_E_INVALID_HANDLE β€” hKey is not a valid handle. bestie. that handle is not it. πŸ™ˆ
  • TSS_E_INTERNAL_ERROR β€” an internal SW error has been detected. something went sideways deep inside and honestly? not your fault, but also not great.
  • TSS_E_BAD_PARAMETER β€” one or more parameters is bad. something you passed in was lowkey wrong.
ngl, if you see anything other than TSS_SUCCESS, go check what you handed in before you go blaming the TPM. just saying. πŸ’œ

🌈 CONFORMING TO 🌈

Tspi_Key_UnloadKey conforms to the Trusted Computing Group Software Specification version 1.1 Golden. it's certified, it's official, it's got the credentials. πŸ‘‘


⭐ SEE ALSO ⭐

go read these next, they're the whole friend group:


and that's the page fr fr πŸ’– this one's from TSS 1.1, dated 2004-05-25, and it's the Tspi_Key_UnloadKey(3) entry β€” main character energy since 2004, no notes. mwah. πŸ’…βœ¨