tpm

package
v0.83.0 Latest Latest
Warning

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

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

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