Tspi_Hash_Sign(3)
π Tspi_Hash_Sign(3) π
okay bestie, welcome to the TCG Software Stack Developer's Reference β this is the Tspi_Hash_Sign(3) page from the Library Functions Manual, and it's literally the moment your hash data gets its signature glow-up. no cap. π¦
β¨ NAME β¨
Tspi_Hash_Sign β sign the hash data of an object with a signing key
like. that's it. that's the whole job. sign the hash data of an object with a signing key. iconic behavior. π
πΈ 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_Hash_Sign(TSS_HHASH hHash, TSS_HKEY hKey,
UINT32 pulSignatureLength, BYTE** prgbSignature);
all those includes? yeah you need every single one of them, don't @ me, just copy them in. π
π DESCRIPTION π
so Tspi_Hash_Sign signs the hash data of an object with a given signing key. simple. elegant. the way that it just does the thing. π₯
BUT β and this is the part where you gotta pay attention, bestie β the data must be set at the hash instance associated with hHash by calling Tspi_Hash_SetHashValue or Tspi_Hash_UpdateHashValue. no data, no signature. it's giving "you have to actually put something in before you ask for something out." π
also real talk: the Tspi_Hash_Sign method allocates a memory block for the prgbSignature data. so that memory is yours now, and you must release it using Tspi_Context_FreeMemory. do not ghost that memory block. free it. it's the respectful thing to do. π«Ά
π PARAMETERS π
π hHash
The handle to the hash object instance whose hash value should be signed.
like, which hash are we signing here, girlie. this is that one.
π hKey
Handle to the key object which should be used for the signature.
the signing key. the main character of this whole operation tbh. π
π pulSignatureLength
Receives the length of the signature data returned at the parameter prgbSignature on successful completion.
it's an out-param! it catches the length of the signature for you once everything works. β¨
π prgbSignature
Receives a pointer to the signature data on successful completion.
and this one catches the actual pointer to the signature data. and again β free that memory with Tspi_Context_FreeMemory, bestie, i am begging. π
β RETURN CODES β
Tspi_Hash_Sign returns TSS_SUCCESS on success (slay π), otherwise one of the following values is returned:
TSS_E_INVALID_HANDLEβhKeyis not a valid handle. like it's just not valid. nope. πTSS_E_INTERNAL_ERRORβ An internal SW error has been detected. not our fault, it's the internals being messy.TSS_E_BAD_PARAMETERβ One or more parameters is bad. something you passed in is misbehaving.TSS_E_HASH_INVALID_LENGTHβ Hash length is inconsistent with hash algorithm. the length and the algorithm are not matching each other's energy. πTSS_E_HASH_NO_DATAβ Hash object has no internal hash value. empty. void. nothing in there. go callTspi_Hash_SetHashValueorTspi_Hash_UpdateHashValuefirst fr fr.TSS_E_HASH_NO_IDENTIFIERβ The hash algorithm identifier is not set. it doesn't even know what algorithm it is. identity crisis core. π
π CONFORMING TO π
Tspi_Hash_Sign conforms to the Trusted Computing Group Software Specification version 1.1 Golden
periodt. that's the spec, that's the standard, that's the vibe. β
π¦ SEE ALSO π¦
go read those too, they're all part of the same little friend group. iykyk. π
and that's the page, bestie!! this one's from TSS 1.1, dated 2004-05-25 β yeah she's an elder but she still eats. go sign something. responsibly. and FREE YOUR MEMORY. πβ¨π
π¦ 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