tpm

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2025 License: BSD-3-Clause Imports: 14 Imported by: 16

Documentation

Overview

Package tpm reads and extends pcrs with measurements.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close closes the connection of a TPM device handle.

func ExtendPCRDebug

func ExtendPCRDebug(pcr uint32, data io.Reader, eventDesc string) error

ExtendPCRDebug extends a PCR with the contents of a byte slice and notifies the kernel of this measurement by sending an event via sysfs.

In debug mode, it prints:

  1. The old PCR value before the hash is extended to the PCR
  2. The new PCR value after the hash is extended to the PCR

func HashReader added in v0.15.0

func HashReader(f io.Reader) []byte

HashReader calculates the sha256 sum of an io reader.

func LogPCRs added in v0.15.0

func LogPCRs(selection []uint32, pcrLogLocation string) error

LogPCRs logs the PCR values out to the provided file.

func New

func New() error

New sets up a TPM device handle that can be used for storing hashes.

func ReadValue32 added in v0.15.0

func ReadValue32(nvIndex uint32) ([]byte, error)

ReadValue32 reads the a 32-bit value from the TPM at the specified index.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL