Tspi_E...ssBlob(3)

Tspi_E...ssBlob πŸ’…βœ¨

okay bestie, welcome to the TCG Software Stack Developer's Reference page for Tspi_EncodeDER_TssBlob β€” it lives in manual section 3, so it's a library call, and it's about to make your raw blob glow up into a DER-encoded one. no cap. πŸ¦‹


✨ NAME ✨

Tspi_EncodeDER_TssBlob β€” generate a DER encoded TSS blob. that's it, that's the whole job, and she does it flawlessly πŸ’–


✨ SYNOPSIS ✨

#include <tss/tspi.h>

TSS_RESULT Tspi_EncodeDER_TssBlob(UINT32 rawBlobSize, BYTE*   rawBlob,
                                  UINT32 blobType,    UINT32* derBlobSize,
                                  BYTE*  derBlob);

look at that signature. five arguments, zero drama. we love a consistent queen πŸ‘‘


✨ DESCRIPTION ✨

so basically, Tspi_EncodeDER_TssBlob is the function you call when you need to generate a DER-encoded blob. and not just any DER encoding β€” it follows the ASN.1 data definitions from the Portable Data section of the Trusted Computing Group Software Stack Specification Version 1.2. literally the spec said "here's the format" and this function said "bet" πŸ”₯


✨ PARAMETERS ✨

rawBlobSize

the size of the unwrapped blob. how big is your baby before the glow-up? that number goes here πŸ’«

rawBlob

a pointer to the unwrapped blob. yes, the raw one. the before picture πŸ“Έ

blobType

the type of blob being wrapped β€” go check the TSS_BLOB_TYPE_* constants for your options, iykyk πŸŽ€

derBlobSize

okay this one is doing the MOST and honestly? respect.

  • On input, this parameter contains a pointer to the maximum size of the supplied derBlob buffer.
  • On output, this parameter contains a pointer to the actual size of the DER-encoded blob.
  • On input, if this parameter points to a value of 0, then this function will return the size of the buffer required to hold the DER-encoded blob without writing to the derBlob buffer. so it's like a lil sizing preview, no commitment, we love a low-stakes vibe check πŸ‘€
Note: If the raw data blob length is less than 2^16 bytes then the DER-encoding may add no more than 20 bytes. tiny overhead, tiny slay πŸ’…

derBlob

a pointer to a buffer to hold the DER-encoded blob. this is where the after picture goes ✨


✨ RETURN CODES ✨

Tspi_EncodeDER_TssBlob returns TSS_SUCCESS on success πŸŽ‰ otherwise one of the following values are returned:

  • TSS_E_BAD_PARAMETER β€” something in your args was giving chaos 😭
  • TSS_E_INTERNAL_ERROR β€” An error occurred internal to the TSS. not your fault bestie, the stack is going through it πŸ’€

✨ CONFORMING TO ✨

Tspi_EncodeDER_TssBlob conforms to the Trusted Computing Group Software Specification Version 1.2. she's certified, she's official, she read the spec and she IS the spec πŸ“œπŸ‘‘


✨ SEE ALSO ✨


and that's the whole page, bestie!! 🫢 this little icon comes to you from TSS 1.2, dated 2007-06-12 β€” an absolute vintage era for the TCG Software Stack, and honestly the docs still ate πŸ’–βœ¨πŸŽ€