Documentation ¶
Overview ¶
Package mssim provides an interface for communicating with a TPM simulator
Index ¶
- Constants
- type Device
- type PlatformCommandErrordeprecated
- type Tctideprecated
- type Transport
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.
The returned transport will automatically retry commands that fail with TPM_RC_RETRY or TPM_RC_YIELDED. It will also retry commands that fail with TPM_RC_TESTING if the command wasn't TPM_CC_SELF_TEST.
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) String ¶ added in v1.1.0
String implements fmt.Stringer.
type PlatformCommandError
deprecated
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.
Deprecated: This never returned.
func (*PlatformCommandError) Error ¶
func (e *PlatformCommandError) Error() string
type Transport ¶ added in v1.4.0
type Transport struct {
// contains filtered or unexported fields
}
Transport 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 Transport instance which can be passed to tpm2.NewTPMContext.
Deprecated: Use NewDevice, NewLocalDevice or DefaultDevice.
func (*Transport) Close ¶ added in v1.4.0
Close implements tpm2.Transport.Close.
func (*Transport) Read ¶ added in v1.4.0
Read implements tpm2.Transport.Read.
func (*Transport) Reset ¶ added in v1.4.0
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().