VirtualBox

source: vbox/trunk/src/libs/libtpms-0.9.0/man/man3/TPMLIB_MainInit.pod@ 95070

最後變更 在這個檔案從95070是 91612,由 vboxsync 提交於 3 年 前

src/libs: Export libtpms-0.9.0, bugref:10078

檔案大小: 2.0 KB
 
1=head1 NAME
2
3TPMLIB_MainInit - Initialize the TPM
4
5TPMLIB_Terminate - Terminate the TPM
6
7=head1 LIBRARY
8
9TPM library (libtpms, -ltpms)
10
11=head1 SYNOPSIS
12
13B<#include <libtpms/tpm_types.h>>
14
15B<#include <libtpms/tpm_library.h>>
16
17B<#include <libtpms/tpm_error.h>>
18
19B<TPM_RESULT TPMLIB_MainInit(void);>
20
21B<TPM_RESULT TPMLIB_Terminate(void);>
22
23=head1 DESCRIPTION
24
25The B<TPMLIB_MainInit()> and B<TPMLIB_Terminate()> functions are used
26to initialize and terminate the TPM respectively. The B<TPMLIB_MainInit()>
27function must be called before the TPM processes any TPM command.
28The B<TPMLIB_Terminate()> function is called to free all the internal
29resources (memory allocations) the TPM has used and must be called after
30the last TPM command was processed by the TPM. The B<TPMLIB_MainInit()>
31function can then be called again.
32
33Use B<TPMLIB_RegisterCallbacks()> to set callback functions for
34initialization and writing and restoring the internal state in a
35portable format.
36
37=head1 ERRORS
38
39=over 4
40
41=item B<TPM_SUCCESS>
42
43The function completed successfully.
44
45=item B<TPM_FAIL>
46
47General failure.
48
49=back
50
51For a complete list of TPM error codes please consult the include file
52B<libtpms/tpm_error.h>
53
54=head1 EXAMPLE
55
56 #include <stdio.h>
57
58 #include <libtpms/tpm_types.h>
59 #include <libtpms/tpm_library.h>
60 #include <libtpms/tpm_error.h>
61
62 int main(void) {
63 TPM_RESULT res;
64 unsigned char *respbuffer = NULL;
65 uint32_t resp_size = 0;
66 uint32_t respbufsize = 0;
67 unsigned char *command;
68 uint32_t command_size;
69
70 [...]
71
72 if (TPMLIB_MainInit() != TPM_SUCCESS) {
73 fprintf(stderr, "Could not start the TPM.\n");
74 return 1;
75 }
76
77 [...]
78 /* build TPM command */
79 [...]
80
81 res = TPMLIB_Process(&respbuffer, &resp_size,
82 &respbufsize,
83 command, command_size);
84 [...]
85
86 TPMLIB_Terminate();
87
88 return 0;
89 }
90
91=head1 SEE ALSO
92
93B<TPMLIB_Process>(3), B<TPMLIB_RegisterCallbacks>(3), B<TPMLIB_GetVersion>(3)
94B<TPMLIB_GetTPMProperty>(3), B<TPMLIB_DecodeBlob>(3)
95
96=cut
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette