Scroll to navigation

TPM2KEY-TOOL(8) Parse and Compare TPM 2.0 Keys TPM2KEY-TOOL(8)

NAME

tpm2key-tool - parse and compare TPM 2.0 key files

SYNOPSIS

tpm2key-tool [-d|--debug] parse key-file

tpm2key-tool [-d|--debug] cmp key-file-1 key-file-2

tpm2key-tool [-h|--help]

DESCRIPTION

tpm2key-tool is a command-line utility designed to parse, inspect, and compare TPM 2.0 private key files. These files are typically stored in the standard ASN.1 DER-encoded format defined by the TPM2.0 key file specification (TSS PrivKey).

OPTIONS

The following options are recognized by tpm2key-tool:

Enable verbose debug logging.
Display a help message and exit.

SUBCOMMANDS

Decodes and prints a detailed, human-readable summary of the specified TPM 2.0 key file. This includes structural elements such as:
  • The TSSPrivKey type (OID)
  • The key's description (if present)
  • The parent handle and public key
  • Any option or authorization policies (including policy steps and command codes)
Compares two TPM 2.0 key files to determine if they share the same base key. This is particularly useful for verifying if two keys were derived or wrapped under the same parent or if they represent the same underlying TPM object with different policies.

EXIT STATUS

The utility returns the following exit status codes:

0
Success, and for the cmp subcommand, both key files represent or share the same base key.
1
Returned by the cmp subcommand only: the keys are valid but do not share the same base key.
2
An error occurred, such as invalid usage, or a specified key file could not be read, parsed, or decoded.

SEE ALSO

pcr-oracle(8)

September 18, 2026 0.6.6