.\" -*- 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_GetTPMProperty 3" .TH TPMLIB_GetTPMProperty 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_GetTPMProperty \- Get a runtime property of the TPM .SH LIBRARY .IX Header "LIBRARY" TPM library (libtpms, \-ltpms) .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fB#include .PP \&\fBTPM_RESULT TPMLIB_GetTPMProperty(enum TPMLIB_TPMProperty, int *result);\fR .SH DESCRIPTION .IX Header "DESCRIPTION" The \fBTPMLIB_GetTPMProperty()\fR call is used to retrieve run-time parameters of the TPM such as the number of authorization sessions it can hold or the maximum sizes of the permanent state, savestate or volatile state blobs. .PP This function can be called before or after the TPM has been created. The current implementation of libtpms will return the same value before and after the TPM was started. .PP With the introduction of the function \fBTPMLIB_ChooseTPMVersion()\fR, the call to this function should be executed after the TPM version has been chosen. The reason is that different TPM versions may return different values. .PP The following properties have been defined: .IP \fBTPMPROP_TPM_RSA_KEY_LENGTH_MAX\fR 4 .IX Item "TPMPROP_TPM_RSA_KEY_LENGTH_MAX" The maximum size of an RSA key. .IP \fBTPMPROP_TPM_BUFFER_MAX\fR 4 .IX Item "TPMPROP_TPM_BUFFER_MAX" The maximum sizes of the TPM command and result buffers. .IP \fBTPMPROP_TPM_KEY_HANDLES\fR 4 .IX Item "TPMPROP_TPM_KEY_HANDLES" The number of key slots. .IP \fBTPMPROP_TPM_OWNER_EVICT_KEY_HANDLES\fR 4 .IX Item "TPMPROP_TPM_OWNER_EVICT_KEY_HANDLES" The number of owner-evict keys. .IP \fBTPMPROP_TPM_MIN_AUTH_SESSIONS\fR 4 .IX Item "TPMPROP_TPM_MIN_AUTH_SESSIONS" The number of authorization sessions. .IP \fBTPMPROP_TPM_MIN_TRANS_SESSIONS\fR 4 .IX Item "TPMPROP_TPM_MIN_TRANS_SESSIONS" The number of transport sessions. .IP \fBTPMPROP_TPM_MIN_DAA_SESSIONS\fR 4 .IX Item "TPMPROP_TPM_MIN_DAA_SESSIONS" The number of DAA sessions. .IP \fBTPMPROP_TPM_MIN_SESSION_LIST\fR 4 .IX Item "TPMPROP_TPM_MIN_SESSION_LIST" The size of the session list. .IP \fBTPMPROP_TPM_MIN_COUNTERS\fR 4 .IX Item "TPMPROP_TPM_MIN_COUNTERS" The number of monotonic counters. .IP \fBTPMPROP_TPM_NUM_FAMILY_TABLE_ENTRY_MIN\fR 4 .IX Item "TPMPROP_TPM_NUM_FAMILY_TABLE_ENTRY_MIN" The number of family entries. .IP \fBTPMPROP_TPM_NUM_DELEGATE_TABLE_ENTRY_MIN\fR 4 .IX Item "TPMPROP_TPM_NUM_DELEGATE_TABLE_ENTRY_MIN" The number of delegate entries. .IP \fBTPMPROP_TPM_SPACE_SAFETY_MARGIN\fR 4 .IX Item "TPMPROP_TPM_SPACE_SAFETY_MARGIN" The space safety margin used for the worst-case sizes of the savestate and volatile state blobs. This safety margin is not used for the size of the permanent data blob. .IP \fBTPMPROP_TPM_MAX_NV_SPACE\fR 4 .IX Item "TPMPROP_TPM_MAX_NV_SPACE" The maximum size of the permanent data blob. .IP \fBTPMPROP_TPM_MAX_SAVESTATE_SPACE\fR 4 .IX Item "TPMPROP_TPM_MAX_SAVESTATE_SPACE" The maximum size of the savestate blob (includes the space safety margin). .IP \fBTPMPROP_TPM_MAX_VOLATILESTATE_SPACE\fR 4 .IX Item "TPMPROP_TPM_MAX_VOLATILESTATE_SPACE" The maximum size of the volatile state blob (includes the space saferty margin). .SH ERRORS .IX Header "ERRORS" .IP \fBTPM_SUCCESS\fR 4 .IX Item "TPM_SUCCESS" The function completed successfully. .IP \fBTPM_FAIL\fR 4 .IX Item "TPM_FAIL" An undefined property was queried. .PP For a complete list of TPM error codes please consult the include file \&\fBlibtpms/tpm_error.h\fR .SH EXAMPLE .IX Header "EXAMPLE" .Vb 1 \& #include \& \& #include \& #include \& \& int main(void) { \& TPM_RESULT res; \& int result; \& int rc = 0; \& \& if (TPMLIB_MainInit() != TPM_SUCCESS) { \& fprintf(stderr, "Could not start the TPM.\en"); \& return 1; \& } \& \& if (TPMLIB_GetTPMProperty(TPMPROP_TPM_RSA_KEY_LENGTH_MAX, &result) \& != TPM_SUCCESS) { \& fprintf(stderr, "Could not read the max. size of RSA keys.\en"); \& goto err_exit; \& } \& \& fprintf(stdout, "Max. size of RSA keys: %d\en", result); \& \& err_exit: \& TPMLIB_Terminate(); \& \& return 0; \& } .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBTPMLIB_MainInit\fR(3), \fBTPMLIB_Terminate\fR(3), \&\fBTPMLIB_Process\fR(3), \fBTPMLIB_RegisterCallbacks\fR(3), \fBTPMLIB_GetVersion\fR(3), \&\fBTPMLIB_ChooseTPMVersion\fR(3)