Tspi_Data_Bind(3)
π Tspi_Data_Bind β from the Library Functions Manual (that's the (3) bestie) π
TCG Software Stack Developer's Reference β¨
πΈ NAME πΈ
Tspi_Data_Bind β encrypts a data 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_Data_Bind(TSS_HENCDATA hEncData, TSS_HKEY hEncKey,
UINT32 ulDataLength, BYTE* rgbDataToBind);
π¦ DESCRIPTION π¦
okay so Tspi_Data_Bind encrypts a data blob in a way that Tspi_Data_Unbind can decrypt it later. it's giving locked-then-unlockable, no cap π
the data blob gets encrypted with a public key operation, using the key that the given encryption key object points at.
now here's the part you need to hear: if you wanna bind data that's larger than the RSA public key modulus, that's on you β it is the responsibility of the caller to do the blocking and then the subsequent combination of the data. the function is not gonna hold your hand on that one, bestie π
the bound data blob lands in the data object addressed by hEncData, and you can pull it out of that object with Tspi_GetAttribData. π
and fr fr: the caller of this function should perform validations that the public key presented to it is from a valid TPM. do not skip the vibe check on that key π
π PARAMETERS π
hEncData
the handle of the data object that holds the encrypted data once the command completes successfully. this is where the glow-up gets stored β¨
hEncKey
handle to the key object addressing the public key that's used to encrypt the data. π
ulDataLength
tells you the length of the data handed over in the rgbDataToBind parameter. π
rgbDataToBind
a pointer to the data that's about to be encrypted. π
π RETURN CODES π
Tspi_Data_Bind returns TSS_SUCCESS when it slays, otherwise one of these lil guys comes back at you:
TSS_E_INVALID_HANDLEβhHashis not a valid handle.TSS_E_INTERNAL_ERRORβ an internal SW error has been detected.TSS_E_BAD_PARAMETERβ one or more parameters is bad.TSS_E_INVALID_ENCSCHEMEβ invalid encryption scheme.TSS_E_ENC_INVALID_LENGTHβ invalid length of data to be encypted.TSS_E_ENC_NO_DATAβ no data to encrypt.TSS_E_ENC_INVALID_TYPEβ invalid encryption type.
π CONFORMING TO π
Tspi_Data_Bind conforms to the Trusted Computing Group Software Specification version 1.1 Golden β
π SEE ALSO π
Tspi_Data_Unbind(3), Tspi_Data_Unseal(3), Tspi_Data_Seal(3).
and that's the whole page, bestie!! this one's from TSS 1.1, dated 2004-05-25 β vintage but iconic, we stan a classic π§π
π¦ where this page comes from
- debian bookworm: libtspi-dev 0.3.15-0.3 Β· BSD-3-Clause
- debian trixie: libtspi-dev 0.3.15-0.4 Β· BSD-3-Clause
- epel 10: trousers-devel 0.3.15-11.el10_0 Β· BSD
- epel 9: trousers-devel 0.3.15-5.el9 Β· BSD
- fedora 43: trousers-devel 0.3.15-15.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-15.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-16.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-16.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: trousers-devel 0.3.15-17.fc44 Β· LicenseRef-Callaway-BSD
- fedora 44: trousers-devel 0.3.15-17.fc44 Β· LicenseRef-Callaway-BSD
- nixos 26.05: trousers 0.3.15
- nixpkgs unstable: netbsd-source 11.0
- nixpkgs unstable: trousers 0.3.15
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- ubuntu jammy: libtspi-dev 0.3.15-0.2 Β· BSD-3-Clause
- ubuntu noble: libtspi-dev 0.3.15-0.3build2 Β· BSD-3-Clause
- ubuntu questing: libtspi-dev 0.3.15-0.4
- ubuntu resolute: libtspi-dev 0.3.15-1 Β· BSD-3-Clause
- ubuntu stonking: libtspi-dev 0.3.15-1ubuntu2 Β· BSD-3-Clause
- Copyright (C) 2004 International Business Machines Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms