Help us shape the future of Go! Take the 2026 Go Developer Survey

tpm

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	// ManufacturerName is the human-readable name of the TPM manufacturer,
	// decoded from the four-character short name the TPM reports (e.g. "AMD",
	// "IFX" for Infineon, "STM" for STMicroelectronics).
	ManufacturerName string `json:"manufacturer_name"`
	// ManufacturerVendorID is the 16-bit TCG Vendor ID assigned to the TPM
	// manufacturer by the Trusted Computing Group. Note that this is a
	// separate namespace from the PCI vendor ID. It may be empty when the
	// host only exposes the manufacturer's short name.
	// See: https://trustedcomputinggroup.org/resource/vendor-id-registry/
	ManufacturerVendorID string `json:"manufacturer_vendor_id"`
	// SpecVersion is the TCG TPM library (specification) version the device
	// implements, i.e. the ISO/IEC 11889 version, e.g. "1.2" or "2.0".
	SpecVersion string `json:"spec_version"`
	// FirmwareVersion is the TPM firmware version, when the host exposes it.
	FirmwareVersion string `json:"firmware_version"`
}

Device describes a single Trusted Platform Module (TPM) present on the host system.

func (*Device) String

func (d *Device) String() string

String returns a short string describing the TPM device.

type Info

type Info struct {
	// Devices are the TPM devices detected under /sys/class/tpm. A host can,
	// in principle, expose more than one TPM device.
	Devices []*Device `json:"devices"`
}

Info describes the Trusted Platform Module(s) on the host system.

func New

func New(args ...any) (*Info, error)

New returns a pointer to an Info struct that contains information about the TPM(s) on the host system.

func (*Info) JSONString

func (i *Info) JSONString(indent bool) string

JSONString returns a string with the TPM information formatted as JSON under a top-level "tpm:" key

func (*Info) String

func (i *Info) String() string

String returns a short string with summary information about the TPM(s) on the host system.

func (*Info) YAMLString

func (i *Info) YAMLString() string

YAMLString returns a string with the TPM information formatted as YAML under a top-level "tpm:" key

Jump to

Keyboard shortcuts

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