mssim

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package mssim provides an interface for communicating with a TPM simulator

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PlatformCommandError

type PlatformCommandError struct {
	Code uint32
	// contains filtered or unexported fields
}

PlatformCommandError corresponds to an error code in response to a platform command executed on a TPM simulator.

func (*PlatformCommandError) Error

func (e *PlatformCommandError) Error() string

type Tcti

type Tcti struct {
	// contains filtered or unexported fields
}

Tcti represents a connection to a TPM simulator that implements the Microsoft TPM2 simulator interface.

func OpenConnection

func OpenConnection(host string, port uint) (*Tcti, error)

OpenConnection attempts to open a connection to a TPM simulator on the specified host and port. The port argument corresponds to the TPM command server. The simulator will also provide a platform server on port+1. If host is an empty string, it defaults to "localhost".

If successful, it returns a new Tcti instance which can be passed to tpm2.NewTPMContext.

func (*Tcti) Close

func (t *Tcti) Close() (err error)

func (*Tcti) MakeSticky

func (t *Tcti) MakeSticky(handle tpm2.Handle, sticky bool) error

func (*Tcti) Read

func (t *Tcti) Read(data []byte) (int, error)

func (*Tcti) Reset

func (t *Tcti) Reset() error

Reset submits the reset command on the platform connection, which initiates a reset of the TPM simulator and results in the execution of _TPM_Init().

func (*Tcti) SetLocality

func (t *Tcti) SetLocality(locality uint8) error

func (*Tcti) Stop

func (t *Tcti) Stop() (out error)

Stop submits a stop command on both the TPM command and platform channels, which initiates a shutdown of the TPM simulator.

func (*Tcti) Write

func (t *Tcti) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

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