---
name: "TPMLIB_ValidateState"
section: "3"
platform: "linux"
package: "libtpms"
version: "0.10.2-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/TPMLIB_ValidateState"
---

# TPMLIB\_ValidateState(3)

Validate the state blobs of the TPM

## NAME

TPMLIB\_ValidateState  - Validate the state blobs of the TPM

## LIBRARY

TPM library (libtpms, -ltpms)

## SYNOPSIS

**#include \<libtpms/tpm\_library.h**\>

**uint32\_t TPMLIB\_ValidateState(TPMLIB\_StateType st,**\
                               **unsigned int flags);**

## DESCRIPTION

The **TPMLIB\_ValidateState()** function allows to validate the state blobs that the TPM would read upon **TPMLIB\_MainInit()** or once the TPM\_Startup command has been sent to it.

This function is useful for TPM state migration between possibly different version of libtpms. Here the target libtpms needs to be able to determine whether it can support the version of blobs that were migrated and if this is not the case, the caller can refuse the migration.

The **tpmlib\_state** parameter can be a logical 'or' of one or multiple of of the following: **TPMLIB\_STATE\_PERMANENT**, **TPMLIB\_STATE\_VOLATILE**, or **TPMLIB\_STATE\_SAVE\_STATE**. The **flags** parameter is currently not used and should be set to 0.

The first state blob that should be loaded is the permanent state, since for example the volatile state requires it to be available for validation.

This function should be called before **TPMLIB\_MainInit()** is invoked.

## SEE ALSO

[**TPMLIB\_MainInit**(3)](/TPMLIB_MainInit/3.md), [**TPMLIB\_Terminate**(3)](/TPMLIB_Terminate/3.md)
