TSPI_KEY_WRAPKEY(3)

πŸ’– Tspi_Key_WrapKey(3) πŸ’–

okay bestie, welcome to the TCG Software Stack Developer's Reference πŸŽ€ this one's a 3-section page (that means it's a library call, iykyk) and it's all about wrapping keys. yes, wrapping. like a lil gift. but cryptographic. let's go ✨


🌸 NAME 🌸

Tspi_Key_WrapKey β€” wrap a key with the key addressed by hWrappingKey.


πŸ¦‹ 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_WrapKey(TSS_HKEY  hKey, TSS_HKEY hWrappingKey,
                            TSS_HPCRS hPcrComposite);

✨ DESCRIPTION ✨

so TSS_Key_WrapKey wraps the private key hKey using the public key addressed by hWrappingKey. that's the whole vibe πŸ’…

if hPcrComposite is not set to NULL (that's 0, bestie), then the key blob it creates gets bound to its PCR values. no cap.

the key object addressed by hKey must contain the key information needed for the creation. periodt.

on a successful return from this call, hKey can be loaded into a TPM πŸ”₯

and listen β€” hKey must have been created as a migratable key, and it should have its usage and migrations secrets set using Tspi_Policy_SetSecret(3). also, hKey should have had its private key set to either RSA private component, p or q. the way that's a whole checklist, I know, but that's just how it is 🫢


πŸŽ€ PARAMETERS πŸŽ€

hKey

the handle of the key object that is wrapped.

hWrappingKey

the handle to the key used to wrap the newly created key.

hPcrComposite

the handle to an object β€” if the value of the handle doesn't equal NULL, the newly created key will be bound to the PCR values described with this object.


⭐ RETURN CODES ⭐

Tspi_Key_WrapKey returns TSS_SUCCESS on success πŸŽ‰ otherwise one of these lil guys comes back at you:

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

🌈 CONFORMING TO 🌈

Tspi_Key_WrapKey conforms to the Trusted Computing Group Software Specification version 1.1 Golden. iconic. πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ


🫢 that's the whole page, bestie. go wrap some keys responsibly. 🧚

TSS 1.1 Β· 2004-05-26 β€” yeah she's an old queen but she still slays πŸ’…βœ¨ bye bb!! πŸ“πŸŽ€πŸ¦‹