tpm

package
v0.83.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: BSD-3-Clause Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tpm is the client's one door to the platform TPM 2.0. It opens the device and turns TPM-held key files into signers; every operation opens the TPM, runs and closes it, so no handle outlives a call.

Index

Constants

View Source
const DeviceEnv = "NB_TPM_DEVICE"

DeviceEnv overrides the TPM device path, which also lets tests point at a swtpm socket.

View Source
const KeyPEMType = "TSS2 PRIVATE KEY"

KeyPEMType is the PEM block type of a TPM 2.0 key file as defined by draft-bottomley-tpm2-keys and written by tpm2-openssl and tpm2-tss-engine.

Variables

View Source
var ErrKeyNeedsAuth = errors.New("TPM key requires an authorization value")
View Source
var ErrUnsupported = errors.New("TPM is not supported on this platform")

Functions

func Open

func Open() (io.ReadWriteCloser, error)

Open connects to the platform TPM 2.0. The caller closes it after one operation.

func ParseKey

func ParseKey(der []byte) (crypto.Signer, error)

ParseKey reads a TSS2 key file and returns a signer that produces every signature inside the TPM; only the digest goes in and only the signature comes out. Keys guarded by an authorization value are rejected, since nothing can supply it without prompting.

Types

This section is empty.

Directories

Path Synopsis
Package tpmtest builds TSS2 key files for tests, with or without a TPM behind them.
Package tpmtest builds TSS2 key files for tests, with or without a TPM behind them.

Jump to

Keyboard shortcuts

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