1TPMLIB_DecodeBlob(3)                                      TPMLIB_DecodeBlob(3)
2
3
4

NAME

6       TPMLIB_DecodeBlob    - Decode a base64-encode TPM blob
7

SYNOPSIS

9       #include <libtpms/tpm_types.h>
10
11       #include <libtpms/tpm_library.h>
12
13       TPM_RESULT TPMLIB_DecodeBlob(const char *buffer,
14                                    enum TPMLIB_BlobType type,
15                                    unsigned char **result
16                                    size_t *result_len);
17

DESCRIPTION

19       The TPMLIB_DecodeBlob() function is used to decode a base64-encoded TPM
20       state blob. The caller must pass what type of blob is expected to be
21       decoded and following that the function will look for the start and end
22       markers of the data.
23
24       The following types of blobs are supported along with their start and
25       end markers:
26
27       BLOB_TYPE_INITSTATE
28           '-----BEGIN INITSTATE-----' marks the beginning of the
29           base64-encoded blob.
30
31           '-----END INITSTATE-----' marks the end of the base64-encoded blob.
32
33       This function is useful when passing state to the TPM inside the
34       callback that is invoked to get the TPM's state blob.  See
35       TPMLIB_RegisterCallbacks(3).
36

ERRORS

38       TPM_SUCCESS
39           The function completed successfully.
40
41       TPM_SIZE
42           The size of a requested buffer exceeds the limit or the system is
43           out of memory.
44
45       TPM_FAIL
46           An error occurred while attempting to decode the blob.
47
48       For a complete list of TPM error codes please consult the include file
49       libtpms/tpm_error.h
50

SEE ALSO

52       TPMLIB_MainInit(3), TPMLIB_RegisterCallbacks(3)
53
54
55
56libtpms                           2022-07-21              TPMLIB_DecodeBlob(3)
Impressum