Documentation
¶
Overview ¶
Package linux provides an interface for communicating with TPMs using a Linux TPM character device
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDefaultNotTPM2Device indicates that the default device is not a TPM device. ErrDefaultNotTPM2Device = errors.New("the default TPM device is not a TPM2 device") // ErrNoPhysicalPresenceInterface indicates that there is no physical presence interface // available for a TPM device. ErrNoPhysicalPresenceInterface = errors.New("no physical presence interface available") // ErrNoResourceManagedDevice indicates that a TPM device has no corresponding resource // managed device. ErrNoResourceManagedDevice = errors.New("no resource managed TPM device available") // ErrNoTPMDevices indicates that there are no TPM devices. ErrNoTPMDevices = errors.New("no TPM devices are available") )
Functions ¶
This section is empty.
Types ¶
type TPMDevice ¶ added in v1.1.0
type TPMDevice struct {
// contains filtered or unexported fields
}
TPMDevice represents a Linux TPM character device.
func (*TPMDevice) MajorVersion ¶ added in v1.1.0
func (d *TPMDevice) MajorVersion() TPMMajorVersion
MajorVersion indicates the TPM version.
func (*TPMDevice) Open ¶ added in v1.1.0
Open implements tpm2.TPMDevice.Open.
func (*TPMDevice) ShouldRetry ¶ added in v1.1.0
ShouldRetry implements tpm2.TPMDevice.ShouldRetry.
func (*TPMDevice) String ¶ added in v1.1.0
String implements fmt.Stringer.
type TPMDeviceRM ¶ added in v1.1.0
type TPMDeviceRM struct {
TPMDevice
// contains filtered or unexported fields
}
TPMDeviceRM represents a Linux TPM character device that makes use of the kernel resource manager.
func (*TPMDeviceRM) RawDevice ¶ added in v1.1.0
func (d *TPMDeviceRM) RawDevice() *TPMDeviceRaw
RawDevice returns the corresponding raw device.
type TPMDeviceRaw ¶ added in v1.1.0
type TPMDeviceRaw struct {
TPMDevice
// contains filtered or unexported fields
}
TPMDeviceRaw represents a raw Linux TPM character device.
func DefaultTPM2Device ¶ added in v1.1.0
func DefaultTPM2Device() (*TPMDeviceRaw, error)
DefaultTPM2Device returns the default TPM2 device. If there are no devices available, then ErrNoTPMDevices is returned. If the default TPM device is not a TPM2 device, then ErrDefaultNotTPM2Device is returned.
func DefaultTPMDevice ¶ added in v1.1.0
func DefaultTPMDevice() (*TPMDeviceRaw, error)
DefaultTPMDevice returns the default TPM device. If there are no devices available, then ErrNoTPMDevices is returned.
func ListTPM2Devices ¶ added in v1.1.0
func ListTPM2Devices() (out []*TPMDeviceRaw, err error)
ListTPMDevices returns a list of all TPM2 devices.
func ListTPMDevices ¶ added in v1.1.0
func ListTPMDevices() (out []*TPMDeviceRaw, err error)
ListTPMDevices returns a list of all TPM devices. Note that this returns all devices, regardless of version.
func (*TPMDeviceRaw) PhysicalPresenceInterface ¶ added in v1.1.0
func (d *TPMDeviceRaw) PhysicalPresenceInterface() (ppi.PPI, error)
PhysicalPresenceInterface returns the physical presence interface associated with this device.
func (*TPMDeviceRaw) ResourceManagedDevice ¶ added in v1.1.0
func (d *TPMDeviceRaw) ResourceManagedDevice() (*TPMDeviceRM, error)
ResourceManagedDevice returns the corresponding resource managed device if one is available.
type TPMMajorVersion ¶ added in v1.2.0
type TPMMajorVersion int
TPMMajorVersion describes the major version of a TPM device.
const ( TPMVersion1 TPMMajorVersion = 1 TPMVersion2 TPMMajorVersion = 2 )
type Tcti ¶ added in v1.1.0
type Tcti struct {
// contains filtered or unexported fields
}
Tcti represents a connection to a Linux TPM character device.
func OpenDevice
deprecated
OpenDevice attempts to open a connection to the Linux TPM character device at the specified path. If successful, it returns a new TctiDevice instance which can be passed to tpm2.NewTPMContext. Failure to open the TPM character device will result in a *os.PathError being returned.
Deprecated: Use TPMDeviceRaw and TPMDeviceRM.
func (*Tcti) MakeSticky ¶ added in v1.1.0
MakeSticky implements tpm2.TCTI.MakeSticky.
func (*Tcti) SetTimeout ¶ added in v1.1.0
SetTimeout implements tpm2.TCTI.SetTimeout.
type TctiDevice
deprecated
type TctiDevice = Tcti
TctiDevice represents a connection to a Linux TPM character device.
Deprecated: Use Tcti