Tspi_K...ateKey(3)

✨ NAME ✨

okay so this is the Tspi_Key_CreateKey page from the TCG Software Stack Developer's Reference (that's the Tspi_K...ateKey(3) one, bestie, the name got squished in the header but it's her πŸ’…) β€”

Tspi_Key_CreateKey β€” makes a key pair inside the TPM, and wraps it with the key that hWrappingKey points at πŸŽ€


🌸 SYNOPSIS 🌸

#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_CreateKey(TSS_HKEY hKey, TSS_HKEY hWrappingKey, TSS_HPCRS hPcrComposite);

πŸ’– DESCRIPTION πŸ’–

So TSS_Key_CreateKey literally calls the TPM command TPM_CreateWrapKey. That's the whole vibe. πŸ¦‹

And here's the tea: if hPcrComposite is not set to NULL, the key blob she creates gets bound to those PCR values. No cap.

Also, the key object that hKey addresses? She has to already contain the key info needed for the creation. Like, she can't cook without ingredients, periodt. πŸ‘‘


πŸŽ€ PARAMETERS πŸŽ€

hKey

The handle of the key object you wanna create. 🫢

hWrappingKey

The handle to the key that's gonna wrap the brand-new baby key. 🌯✨

hPcrComposite

The handle to an object β€” and if the value of that handle doesn't equal NULL, the newly created key gets bound to the PCR values described by this object. πŸ‘€


πŸ”₯ RETURN CODES πŸ”₯

Tspi_Key_CreateKey returns TSS_SUCCESS when everything slays, otherwise one of these comes back at you:

  • TSS_E_INVALID_HANDLE β€” either hKey, hWrappingKey or hPcrComposite are invalid parameters. 😭
  • TSS_E_INTERNAL_ERROR β€” an error occurred internal to the TSS. πŸ’€

πŸ‘‘ CONFORMING TO πŸ‘‘

Tspi_Key_CreateKey conforms to the Trusted Computing Group Software Specification version 1.1 Golden. iconic behavior, honestly ⭐


🌈 SEE ALSO 🌈


and that's the whole page, bestie πŸ’œ this one came out of TSS 1.1 and it's dated 2004-05-26 β€” she's vintage, she's a legend, she ate and left no crumbs πŸ§šπŸ“