1 | =head1 NAME
|
---|
2 |
|
---|
3 | TPMLIB_DecodeBlob - Decode a base64-encode TPM blob
|
---|
4 |
|
---|
5 | =head1 SYNOPSIS
|
---|
6 |
|
---|
7 | B<#include <libtpms/tpm_types.h>>
|
---|
8 |
|
---|
9 | B<#include <libtpms/tpm_library.h>>
|
---|
10 |
|
---|
11 | B<TPM_RESULT TPMLIB_DecodeBlob(const char> *I<buffer>B<,
|
---|
12 | enum TPMLIB_BlobType> I<type>B<,
|
---|
13 | unsigned char> **I<result>B<
|
---|
14 | size_t> *I<result_len>B<);>
|
---|
15 |
|
---|
16 | =head1 DESCRIPTION
|
---|
17 |
|
---|
18 | The B<TPMLIB_DecodeBlob()> function is used to decode a base64-encoded
|
---|
19 | TPM state blob. The caller must pass what type of blob is expected to be
|
---|
20 | decoded and following that the function will look for the start and
|
---|
21 | end markers of the data.
|
---|
22 |
|
---|
23 | The following types of blobs are supported along with their start and
|
---|
24 | end markers:
|
---|
25 |
|
---|
26 | =over 4
|
---|
27 |
|
---|
28 | =item B<BLOB_TYPE_INITSTATE>
|
---|
29 |
|
---|
30 | '-----BEGIN INITSTATE-----' marks the beginning of the base64-encoded blob.
|
---|
31 |
|
---|
32 | '-----END INITSTATE-----' marks the end of the base64-encoded blob.
|
---|
33 |
|
---|
34 | =back
|
---|
35 |
|
---|
36 | This function is useful when passing state to the TPM inside the
|
---|
37 | callback that is invoked to get the TPM's state blob.
|
---|
38 | See I<TPMLIB_RegisterCallbacks>(3).
|
---|
39 |
|
---|
40 | =head1 ERRORS
|
---|
41 |
|
---|
42 | =over 4
|
---|
43 |
|
---|
44 | =item B<TPM_SUCCESS>
|
---|
45 |
|
---|
46 | The function completed successfully.
|
---|
47 |
|
---|
48 | =item B<TPM_SIZE>
|
---|
49 |
|
---|
50 | The size of a requested buffer exceeds the limit or the
|
---|
51 | system is out of memory.
|
---|
52 |
|
---|
53 | =item B<TPM_FAIL>
|
---|
54 |
|
---|
55 | An error occurred while attempting to decode the blob.
|
---|
56 |
|
---|
57 | =back
|
---|
58 |
|
---|
59 | For a complete list of TPM error codes please consult the include file
|
---|
60 | B<libtpms/tpm_error.h>
|
---|
61 |
|
---|
62 | =head1 SEE ALSO
|
---|
63 |
|
---|
64 | B<TPMLIB_MainInit>(3), B<TPMLIB_RegisterCallbacks>(3)
|
---|
65 |
|
---|
66 | =cut
|
---|