TSPI_CONTEXT_GETKEYBYPUBLICINFO(3)
π Tspi_Context_GetKeyByPublicInfo(3) π
okay bestie, gather round, because this one is a TCG Software Stack Developer's Reference page and it's genuinely kind of iconic. it's from the TSS crew, manual name Tspi_C...licInfo(3) (yes the title gets truncated like that, it's giving "my name is too long for the header", we love her anyway) π
β¨ NAME β¨
Tspi_Context_GetKeyByPublicInfo β search the persistent storage for a registered key using the provided public key information
πΈ 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_GetKeyByPublicInfo(TSS_HCONTEXT hContext, TSS_FLAG persistentStorageType,
TSS_ALGORITHM_ID algID, UINT32 ulPublicInfoLength,
BYTE* rgbPublicInfo, TSS_HKEY* phKey);
like, look at that signature. seven includes just to say hi. she's high maintenance and she's worth it π
π¦ DESCRIPTION π¦
so TSS_Context_GetKeyByPublicInfo goes and searches the persistent storage for a registered key, using the public key info you hand it, and then it creates a key object initialized according to the data it found. no cap, that's the whole vibe.
and when the method completes successfully? you get back a handle to that brand-new key object it just made. a little gift. a little treat. π«Ά
π PARAMETERS π
hContext
the handle of the context object. your entry ticket, your little backstage pass. β¨
persistentStorageType
a flag indicating which persistent storage the key is registered in. i.e. where in the storage world we're looking. πΊοΈ
algId
this parameter indicates the algorithm of the requested key. what kind of key are we even asking for, bestie. π€
ulPublicInfoLength
the length of the public key info provided at the parameter rgbPublicInfo. just the size. the measurements. π
rgbPublicInfo
the public key info is provided to identify the key to look for in the persistent storage. important detail: in case algID equals TSS_ALG_RSA, this parameter contains the modulus of the public RSA key. so if you're doing RSA, that's the thing that goes here, not something else. noted. π
hKey
receives the handle of the key object representing the key. and β big mood β in case the key hasn't been found, this value will be NULL. so check it, fr fr. π
π₯ RETURN CODES π₯
Tspi_Context_GetKeyByPublicInfo returns TSS_SUCCESS on success. otherwise one of these little guys comes back at you:
TSS_E_INVALID_HANDLEβhContextis an invalid handle. πTSS_E_INTERNAL_ERRORβ an error occurred internal to the TSS. not our fault, not your fault, the TSS is just going through something.
π CONFORMING TO π
Tspi_Context_GetKeyByPublicInfo conforms to the Trusted Computing Group Software Specification version 1.1 Golden. certified, spec-compliant, main character energy. β
π SEE ALSO π
like if you liked this one, you'll love that one. iykyk. π
ok and one last thing:algIDvsalgIdβ the docs spell it both ways in the description and the parameter name. i am simply reporting the lore, not fixing it. π
that's the whole page, bestie! this one came to you from the TSS 1.1 era, dated 2004-05-26, out of the TCG Software Stack Developer's Reference set β so yeah, vintage, but she still ate. go forth and get those keys. π§ββοΈβ¨π
π¦ 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