Tspi_C...ByUUID(3)

πŸ’– Tspi_C...ByUUID(3) β€” TCG Software Stack Developer's Reference πŸ’–

okay bestie, so this is a page from the TCG Software Stack Developer's Reference, and yes the man page name is literally abbreviated with ... in it, that's just how they do it here, don't @ me. it's about pulling up your registered keys, and honestly? iconic behavior.


✨ NAME ✨

Tspi_Context_GetRegisteredKeysByUUID β€” get an array of TSS_KM_KEYINFO structures based on the state of persistent storage.

like, it goes and fetches the whole rundown of what keys are living in persistent storage rn. very much giving "let me check the group chat history" energy.


🌸 SYNOPSIS 🌸

first, the includes, because you cannot sit with us without them:

#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>

and then the actual function, look at her:

TSS_RESULT Tspi_Context_GetRegisteredKeysByUUID(TSS_HCONTEXT     hContext,  TSS_FLAG persistentStorageType,
                                                TSS_UUID*        pUuidData, UINT32*  pulKeyHierarchySize,
                                                TSS_KM_KEYINFO** ppKeyHierarchy);

she takes five things and she gives you back a TSS_RESULT. periodt.


πŸ¦‹ DESCRIPTION πŸ¦‹

TSS_Context_GetRegisteredKeysByUUID (yes, the man page says TSS_Context_... in the description and Tspi_Context_... everywhere else, we don't make the rules, we just report them πŸ’€) gets an array of TSS_KM_KEYINFO structures.

this info reflects the state of the registered key hierarchy. and here's the tea: the keys stored in the persistent storage are totally independent from either the context you passed in the function call, or the context that was provided while the key registration was being processed. like, they do not care about your context, they have their own life. main character keys fr.


πŸŽ€ PARAMETERS πŸŽ€

hContext

the handle of the context object. your little context badge, your entry pass, your VIP wristband. 🫢

persistentStorageType

flag indicating the persistent storage the key is registered in. which storage? that storage. you tell it.

pUuidData

the UUID the key was registered in the persistent storage (TSP or connected TCS).

okay so this one has layers, listen up:

  • if no key UUID is provided β€” meaning KeyUUID is NULL β€” the returned array of the TSS_KM_KEYINFO structure contains data reflecting the whole key hierarchy starting with root key. the full family tree, no cuts. 🌈
  • if a certain key's UUID is provided, the returned array of TSS_KM_KEYINFO structures only contains data reflecting the path of the key hierarchy regarding that key. the first array entry is the key addressed by the given UUID, followed by its parent key, up to the root key. so it's like... you asked for one cousin and got the ancestry line up to the grandparents. slay.

pulKeyHierarchySize

receives the length (number of array entries) of the ppKeyHierarchy parameter. she's the counter, she tells you how many entries you got. πŸ“

ppKeyHierarchy

on successful completion of the command, this parameter points to a buffer containing the actual key hierarchy data. the real goods. the receipts. πŸ’…


πŸ”₯ RETURN CODES πŸ”₯

Tspi_Context_GetRegisteredKeysByUUID returns TSS_SUCCESS on success, otherwise one of the following values are returned:

  • TSS_E_INVALID_HANDLE β€” hContext is an invalid handle. bestie that handle is not it. 😭
  • TSS_E_BAD_PARAMETER β€” the parameters said no. πŸ™ˆ
  • TSS_E_INTERNAL_ERROR β€” an error occurred internal to the TSS. not your fault, it's giving inside job πŸ’€
lowkey important: only TSS_SUCCESS means you're good. anything else means go read the list again.

πŸ‘‘ CONFORMING TO πŸ‘‘

Tspi_Context_GetRegisteredKeysByUUID conforms to the Trusted Computing Group Software Specification version 1.1 Golden. yes, Golden. as in, it ate and left no crumbs. ⭐


🌟 SEE ALSO 🌟

go read that one next, iykyk. 🧚


TSS 1.1 Β· 2004-05-26 β€” yeah this page is old enough to have its own driver's license, but the info still hits. mwah, take care of your keys bestie πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά