Documentation ¶
Overview ¶
Package mssim provides an interface for communicating with a TPM simulator
Index ¶
- Constants
- type Device
- type PlatformCommandError
- type Tcti
- func (t *Tcti) Close() (err error)
- func (t *Tcti) MakeSticky(handle tpm2.Handle, sticky bool) error
- func (t *Tcti) Read(data []byte) (int, error)
- func (t *Tcti) Reset() error
- func (t *Tcti) SetLocality(locality uint8) error
- func (t *Tcti) SetTimeout(timeout time.Duration) error
- func (t *Tcti) Stop() (out error)
- func (t *Tcti) Write(data []byte) (int, error)
Constants ¶
const (
DefaultPort uint = 2321
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶ added in v1.1.0
type Device struct {
// contains filtered or unexported fields
}
Device describes a TPM simulator device.
var (
DefaultDevice *Device = &Device{port: DefaultPort}
)
func NewDevice ¶ added in v1.1.0
NewDevice returns a new device structure for the specified host and port.
func NewLocalDevice ¶ added in v1.1.0
NewLocalDevice returns a new device structure for the specified port on the local machine.
func (*Device) Open ¶ added in v1.1.0
Open implements tpm2.TPMDevice.Open.
func (*Device) Port ¶ added in v1.1.0
Port is the port number of the TPM simulator's command channel. Its platform channel runs on the next port number.
func (*Device) ShouldRetry ¶ added in v1.1.0
ShouldRetry implements tpm2.TPMDevice.ShouldRetry.
func (*Device) String ¶ added in v1.1.0
String implements fmt.Stringer.
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
deprecated
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.
Deprecated: Use NewDevice, NewLocalDevice or DefaultDevice.
func (*Tcti) MakeSticky ¶
MakeSticky implements tpm2.TCTI.MakeSticky.
func (*Tcti) Reset ¶
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 ¶
SetLocality sets the locality to be used for the next command.