Tspi_Data_Seal(3)

πŸ’– Tspi_Data_Seal(3) πŸ’–

okay bestie, welcome to the TCG Software Stack Developer's Reference β€” this one's a classic, let's get into it 🫢


✨ NAME ✨

Tspi_Data_Seal β€” encrypts a data blob in a way that only Tspi_Data_Unseal can decrypt it, and only on the same system. no cap, it's locked to that machine πŸ’…


🌸 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_Data_Seal(TSS_HENCDATA hEncData,     TSS_HKEY hEncKey,
                          UINT32       ulDataLength, BYTE*    rgbDataToSeal,
                          TSS_HPCRS    hPcrComposite);

πŸ¦‹ DESCRIPTION πŸ¦‹

Tspi_Data_Seal takes a data blob and encrypts it in a way that it can only be decrypted by Tspi_Data_Unseal, and only on the same system. literally tied to the machine, it's giving exclusive πŸ’€

The way it works? The blob gets encrypted with a public key operation</>, using the nonmigratable key that the given encryption key object points at. that key is not going anywhere, bestie, and neither is your data πŸ”₯


πŸŽ€ PARAMETERS πŸŽ€

hEncData

The handle of the data object β€” and guess what, on successful completion of the command this is where your sealed data lives πŸ‘‘ so yeah, kind of a big deal.

hEncKey

The handle to the key object that addresses the nonmigratable key used to encrypt the data. πŸ”

ulDataLength

The length, in bytes, of the rgbDataToSeal parameter. numbers matter, periodt.

rgbDataToSeal

A pointer to the memory holding the data you wanna encrypt. πŸ“

hPcrComposite

The handle of the PCR Composite object that specifies which PCRs are part of the sealed data blob. ✨

set this to NULL if you want the encrypted data to only be bound to the system and PCRs are just not it for you πŸ™ˆ

⭐ RETURN CODES ⭐

Tspi_Data_Seal returns TSS_SUCCESS when everything slays, otherwise one of these little guys shows up:

  • TSS_E_INVALID_HANDLE β€” one of the following parameters is invalid: hEncData, hEncKey, rgbDataToSeal. πŸ’€
  • TSS_E_INTERNAL_ERROR β€” something went wrong internal to the TSS. not our fault, it's giving mystery 😭

πŸ’œ CONFORMING TO πŸ’œ

Tspi_Data_Seal 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's from TSS 1.1, dated 2004-05-26 β€” vintage but still ate πŸŽ€βœ¨ bye ilysm 🫢