.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "TPMLIB_DecodeBlob 3" .TH TPMLIB_DecodeBlob 3 2024-03-09 libtpms "" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME TPMLIB_DecodeBlob \- Decode a base64\-encode TPM blob .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fB#include .PP \&\fB#include .PP \&\fBTPM_RESULT TPMLIB_DecodeBlob(const char\fR *\fIbuffer\fR\fB, enum TPMLIB_BlobType\fR \fItype\fR\fB, unsigned char\fR **\fIresult\fR\fB size_t\fR *\fIresult_len\fR\fB);\fR .SH DESCRIPTION .IX Header "DESCRIPTION" The \fBTPMLIB_DecodeBlob()\fR function is used to decode a base64\-encoded TPM state blob. The caller must pass what type of blob is expected to be decoded and following that the function will look for the start and end markers of the data. .PP The following types of blobs are supported along with their start and end markers: .IP \fBBLOB_TYPE_INITSTATE\fR 4 .IX Item "BLOB_TYPE_INITSTATE" \&'\-\-\-\-\-BEGIN INITSTATE\-\-\-\-\-' marks the beginning of the base64\-encoded blob. .Sp \&'\-\-\-\-\-END INITSTATE\-\-\-\-\-' marks the end of the base64\-encoded blob. .PP This function is useful when passing state to the TPM inside the callback that is invoked to get the TPM's state blob. See \fITPMLIB_RegisterCallbacks\fR(3). .SH ERRORS .IX Header "ERRORS" .IP \fBTPM_SUCCESS\fR 4 .IX Item "TPM_SUCCESS" The function completed successfully. .IP \fBTPM_SIZE\fR 4 .IX Item "TPM_SIZE" The size of a requested buffer exceeds the limit or the system is out of memory. .IP \fBTPM_FAIL\fR 4 .IX Item "TPM_FAIL" An error occurred while attempting to decode the blob. .PP For a complete list of TPM error codes please consult the include file \&\fBlibtpms/tpm_error.h\fR .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBTPMLIB_MainInit\fR(3), \fBTPMLIB_RegisterCallbacks\fR(3)