TSPI_CONTEXT_CREATEOBJECT(3)
π NAME π
Tspi_Context_CreateObject β bestie, this one makes you an empty object and hands you a handle to it. That's it. That's the whole job. Slay. β¨
πΈ 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_CreateObject(TSS_HCONTEXT hContext, TSS_FLAG objectType,
TSS_FLAG initFlags, TSS_HOBJECT* phObject);
π¦ DESCRIPTION π¦
okay so. TSS_Context_CreateObject creates and initializes an empty object of the type you asked for, and then hands you back a handle that points at that object. β¨
And here's the key part, bestie: that object is bound to an already opened context hContext. Already opened. Like, you can't just manifest a context out of thin air here. It has to exist first. π₯
π PARAMETERS π
hContext
The handle of the context object. That's your context. Your girl. Your whole foundation. π
objectType
A flag telling the function what kind of object to create. The possible types are:
TSS_OBJECT_TYPE_POLICYβ a policy object.TSS_OBJECT_TYPE_ENCDATAβ an encrypted data object (either sealed or bound data).TSS_OBJECT_TYPE_RSAKEYβ an RSA key.TSS_OBJECT_TYPE_PCRSβ a PCR composite object.TSS_OBJECT_TYPE_HASHβ a hash object.
initFlags
A flag for the default attributes of the object. And the attributes are different for every single object type, so buckle up. π’
Policy:
TSS_POLICY_USAGEβ a usage policy (for authorization to use an object).TSS_POLICY_MIGRATIONβ a migration policy.
Encrypted data objects:
TSS_ENCDATA_SEALβ A data object used for a Seal operation.TSS_ENCDATA_BINDβ A data object used for a Bind operation.TSS_ENCDATA_LEGACYβ A data object for a bind operation using a legacy key.
RSA Keys:
TSS_KEY_SIZE_DEFAULTβ Use the default key size of the TCS you're connected to.TSS_KEY_SIZE_512β Create a 512 bit key.TSS_KEY_SIZE_1024β Create a 1024 bit key.TSS_KEY_SIZE_2048β Create a 2048 bit key.TSS_KEY_SIZE_4096β Create a 4096 bit key.TSS_KEY_SIZE_8192β Create a 8192 bit key.TSS_KEY_SIZE_16384β Create a 16384 bit key.TSS_KEY_TYPE_STORAGEβ Create a storage key. (Used to wrap other keys).TSS_KEY_TYPE_SIGNINGβ Create a signing key.TSS_KEY_TYPE_BINDβ Create a binding key. (Used to encrypt data).TSS_KEY_TYPE_IDENTITYβ Create an identity key. (Used for an identity).TSS_KEY_TYPE_LEGACYβ Create a legacy key. (Can be used for signing and binding, created from data external to a TSS).TSS_KEY_TYPE_AUTHCHANGEβ Create an ephemeral key used to change authorization values.TSS_KEY_VOLATILEβ Create a volatile key. (Must be unloaded at startup).TSS_KEY_NON_VOLATILEβ Create a non-volatile key. (May be unloaded at startup).TSS_KEY_MIGRATABLEβ Create a migratable key.TSS_KEY_NOT_MIGRATABLEβ Create a non-migratable key. [DEFAULT]TSS_KEY_AUTHORIZATIONβ Key will require authorization.TSS_KEY_NO_AUTHORIZATIONβ Key will not require authorization. [DEFAULT]TSS_KEY_EMPTY_KEYβ Key template which will be returned as an object with very few attributes.
PCR composite objects:
- None.
not a single one. the PCR composite object said "no thoughts, head empty" and honestly? iconic. π§
Hash objects:
TSS_HASH_SHA1β a hash object of type SHA-1.TSS_HASH_OTHERβ a hash object of type other than SHA-1.
phObject
The handle of the object to be created. π«Ά
π RETURN CODES π
Tspi_Context_CreateObject returns TSS_SUCCESS on success. Otherwise, one of these little guys comes back at you:
TSS_E_INVALID_HANDLEβ EitherhContextorphObjectis an invalid handle.TSS_E_INTERNAL_ERRORβ An error occurred internal to the TSS.
fr fr if you're gettingTSS_E_INVALID_HANDLE, check BOTH handles. Not just one. Both.hContextandphObjectare on the suspect list. π
π CONFORMING TO π
Tspi_Context_CreateObject conforms to the Trusted Computing Group Software Specification version 1.1 Golden. β¨
π SEE ALSO π
and that's the whole page, bestie. you created an object, you got a handle, you closed the loop. π
this was TSS 1.1, dated 2004-05-26 β the TCG Software Stack Developer's Reference, section 3, Tspi_C...eObject(3), still serving looks after all these years. π β¨
π¦ 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