Tspi_Conte...dKeyByBlob(3)

πŸ’– Tspi_Context_LoadKeyByBlob(3) πŸ’–

okay bestie, listen up β€” this one's from the TCG Software Stack Developers Reference, a Library Functions Manual page, and it's literally the glow-up your key blob has been waiting for ✨


🌸 NAME 🌸

Tspi_Context_LoadKeyByBlob β€” load a key into the TPM using the key's blob 🫢


✨ 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_Context_LoadKeyByBlob(TSS_HCONTEXT hContext,     TSS_HKEY hUnwrappingKey,
                                      UINT32       ulBlobLength, BYTE*    rgbBlobData,
                                      TSS_HKEY*    phKey);

like, that's the whole vibe. seven includes and one function. we love a minimal queen πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea πŸ“ β€” Tspi_Context_LoadKeyByBlob creates a key based on the information gotten by the key blob. then it loads that key into the TPM, and the TPM unwraps the key blob by using the key associated with hUnwrappingKey. the key blob addressed by hUnwrappingKey must have been already loaded into the TPM β€” no skipping steps, bestie, that's not optional πŸ’€

and then? this function returns a handle to the created key object. iconic behavior honestly.


πŸŽ€ PARAMETERS πŸŽ€

hContext

the hContext parameter is the handle of the context object. it's the main character of the whole operation πŸ’…

hUnwrappingKey

the hUnwrappingKey parameter is the handle of the key object which should be used to unwrap the key information associated with rgbBlobData. yes, it's the one doing the unwrapping. give her her flowers 🌸

rgbBlobData

the rgbBlobData parameter is the wrapped key to load. that's it, that's the blob πŸ“¦

phKey

the phKey parameter receives the handle of the key object representing the loaded key. so you hand it a spot and it fills it in. cute, right? πŸ’œ


πŸ”₯ RETURN CODES πŸ”₯

Tspi_Context_LoadKeyByBlob returns TSS_SUCCESS on success, otherwise one of the following values is returned:

  • TSS_E_INVALID_HANDLE β€” hContext is not a valid handle. red flag, bestie 🚩
  • TSS_E_INTERNAL_ERROR β€” an internal SW error has been detected. not us, it's the software 😭
  • TSS_E_BAD_PARAMETER β€” one or more parameters is bad. something you passed in is giving chaos πŸ™ˆ

πŸ‘‘ CONFORMING TO πŸ‘‘

Tspi_Context_LoadKeyByBlob conforms to the Trusted Computing Group Software Specification version 1.1 Golden ✨ certified, no cap.


🌈 SEE ALSO 🌈


and that's the whole page, babe. go load some keys, you got this πŸ’–

TSS 1.1 Β· dated 2004-05-25 Β· that's the TSS 1.1 era, we stan a vintage legend πŸŽ€ mwah, bye bestie πŸ¦‹βœ¨