TSPI_CONTEXT_GETKEYBYUUID(3)

✨ Tspi_Context_GetKeyByUUID β€” it's giving "find my key" ✨

okay bestie, so this one lives in the Library Functions Manual section of the TCG Software Stack Developers Reference, and it's literally the glow-up you need when your key is out there registered in persistent storage and you're like "where is she πŸ’…". Manual name's Tspi_Context_GetKeyByUUID(3), in case you were wondering. Let's go πŸ¦‹


πŸŽ€ NAME πŸŽ€

Tspi_Context_GetKeyByUUID β€” get a handle to a key registered in persistent storage.

no cap, that's the whole vibe: you got a UUID, she got a key, you want them to meet 🫢

✨ 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_GetKeyByUUID(TSS_HCONTEXT hContext, TSS_FLAG  persistentStorageType,
                                     TSS_UUID     uuidData, TSS_HKEY* phKey);

like, include the whole lil family of headers, she needs all of them, don't skip a single one πŸ™ˆ


πŸ’– DESCRIPTION πŸ’–

So Tspi_Context_GetKeyByUUID goes rummaging through the Persistent Storage database looking for a key that's registered under the UUID you hand her. When she finds it β€” boom β€” she creates a key object initialized with the data she found, and hands you back a handle to that key object. it's giving matchmaker energy fr fr πŸ’…


🌸 PARAMETERS 🌸

hContext

The hContext parameter is the handle of the context object. your main character context, basically πŸ‘‘

persistentStorageType

The persistentStorageType parameter tells you which persistent storage the key is registered in. like, which shelf she's sitting on πŸŽ€

uuidData

The uuidData parameter is the UUID by which the key is registered in persistent storage. this is the ✨name tag✨ you're searching by.

phKey

The phKey parameter receives the handle of the key object representing the key. this is the lil gift bag she hands back to you 🫢


πŸ”₯ RETURN CODES πŸ”₯

Tspi_Context_GetKeyByUUID returns TSS_SUCCESS on success β€” slay β€” otherwise one of these bad boys comes back at you:

  • TSS_E_INVALID_HANDLE β€” hContext is an invalid handle. she doesn't know her 😭
  • TSS_E_PS_KEY_NOTFOUND β€” the key cannot be found in the persistent storage database. she's not there bestie, i looked πŸ’€
  • TSS_E_INTERNAL_ERROR β€” an internal SW error has been detected. something broke inside and it's not your fault πŸ™ˆ
  • TSS_E_BAD_PARAMETER β€” one or more parameters is bad. ngl, check your args πŸ’…

πŸ‘‘ CONFORMING TO πŸ‘‘

Tspi_Context_GetKeyByUUID conforms to the Trusted Computing Group Software Specification version 1.1 Golden. iconic. periodt. ⭐


🌈 SEE ALSO 🌈


and that's the whole page, bestie πŸ’œ this was TSS 1.1, dated 2004-05-25, and it came to you straight from the TCG Software Stack Developers Reference. go get your key, you got this πŸ§šβœ¨πŸ“