VirtualBox

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

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

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

檔案大小: 3.3 KB
 
1=head1 NAME
2
3TPMLIB_GetTPMProperty - Get a runtime property of the TPM
4
5=head1 LIBRARY
6
7TPM library (libtpms, -ltpms)
8
9=head1 SYNOPSIS
10
11B<#include <libtpms/tpm_library.h>>
12
13B<TPM_RESULT TPMLIB_GetTPMProperty(enum TPMLIB_TPMProperty, int *result);>
14
15=head1 DESCRIPTION
16
17The B<TPMLIB_GetTPMProperty()> call is used to retrieve run-time parameters
18of the TPM such as the number of authorization sessions it can hold or
19the maximum sizes of the permanent state, savestate or volatile state blobs.
20
21This function can be called before or after the TPM has been created.
22The current implementation of libtpms will return the same value before
23and after the TPM was started.
24
25With the introduction of the function B<TPMLIB_ChooseTPMVersion()>,
26the call to this function should be executed after the TPM version
27has been chosen. The reason is that different TPM versions may return
28different values.
29
30The following properties have been defined:
31
32=over 4
33
34=item B<TPMPROP_TPM_RSA_KEY_LENGTH_MAX>
35
36The maximum size of an RSA key.
37
38=item B<TPMPROP_TPM_BUFFER_MAX>
39
40The maximum sizes of the TPM command and result buffers.
41
42=item B<TPMPROP_TPM_KEY_HANDLES>
43
44The number of key slots.
45
46=item B<TPMPROP_TPM_OWNER_EVICT_KEY_HANDLES>
47
48The number of owner-evict keys.
49
50=item B<TPMPROP_TPM_MIN_AUTH_SESSIONS>
51
52The number of authorization sessions.
53
54=item B<TPMPROP_TPM_MIN_TRANS_SESSIONS>
55
56The number of transport sessions.
57
58=item B<TPMPROP_TPM_MIN_DAA_SESSIONS>
59
60The number of DAA sessions.
61
62=item B<TPMPROP_TPM_MIN_SESSION_LIST>
63
64The size of the session list.
65
66=item B<TPMPROP_TPM_MIN_COUNTERS>
67
68The number of monotonic counters.
69
70=item B<TPMPROP_TPM_NUM_FAMILY_TABLE_ENTRY_MIN>
71
72The number of family entries.
73
74=item B<TPMPROP_TPM_NUM_DELEGATE_TABLE_ENTRY_MIN>
75
76The number of delegate entries.
77
78=item B<TPMPROP_TPM_SPACE_SAFETY_MARGIN>
79
80The space safety margin used for the worst-case sizes of the savestate and
81volatile state blobs. This safety margin is not used for the size of the
82permanent data blob.
83
84=item B<TPMPROP_TPM_MAX_NV_SPACE>
85
86The maximum size of the permanent data blob.
87
88=item B<TPMPROP_TPM_MAX_SAVESTATE_SPACE>
89
90The maximum size of the savestate blob (includes the space safety margin).
91
92=item B<TPMPROP_TPM_MAX_VOLATILESTATE_SPACE>
93
94The maximum size of the volatile state blob (includes the space saferty
95margin).
96
97=back
98
99=head1 ERRORS
100
101=over 4
102
103=item B<TPM_SUCCESS>
104
105The function completed successfully.
106
107=item B<TPM_FAIL>
108
109An undefined property was queried.
110
111=back
112
113For a complete list of TPM error codes please consult the include file
114B<libtpms/tpm_error.h>
115
116=head1 EXAMPLE
117
118 #include <stdio.h>
119
120 #include <libtpms/tpm_library.h>
121 #include <libtpms/tpm_error.h>
122
123 int main(void) {
124 TPM_RESULT res;
125 int result;
126 int rc = 0;
127
128 if (TPMLIB_MainInit() != TPM_SUCCESS) {
129 fprintf(stderr, "Could not start the TPM.\n");
130 return 1;
131 }
132
133 if (TPMLIB_GetTPMProperty(TPMPROP_TPM_RSA_KEY_LENGTH_MAX, &result)
134 != TPM_SUCCESS) {
135 fprintf(stderr, "Could not read the max. size of RSA keys.\n");
136 goto err_exit;
137 }
138
139 fprintf(stdout, "Max. size of RSA keys: %d\n", result);
140
141 err_exit:
142 TPMLIB_Terminate();
143
144 return 0;
145 }
146
147=head1 SEE ALSO
148
149B<TPMLIB_MainInit>(3), B<TPMLIB_Terminate>(3),
150B<TPMLIB_Process>(3), B<TPMLIB_RegisterCallbacks>(3), B<TPMLIB_GetVersion>(3),
151B<TPMLIB_ChooseTPMVersion>(3)
152
153=cut
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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