Documentation ¶
Overview ¶
Package linux provides an interface for communicating with TPMs using a Linux TPM character device
Index ¶
- Variables
- type Device
- type RMDevice
- type RawDevice
- type TPMDevicedeprecated
- type TPMDeviceRMdeprecated
- type TPMDeviceRawdeprecated
- type TPMMajorVersion
- type Tctideprecated
- type TctiDevicedeprecated
- type Transport
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 Device ¶ added in v1.4.0
type Device struct {
// contains filtered or unexported fields
}
Device represents a Linux TPM character device.
func (*Device) MajorVersion ¶ added in v1.4.0
func (d *Device) MajorVersion() TPMMajorVersion
MajorVersion indicates the TPM version.
func (*Device) Open ¶ added in v1.4.0
Open implements tpm2.TPMDevice.Open. The returned transport cannot be used from multiple goroutines simultaneously.
func (*Device) PartialReadSupported ¶ added in v1.4.0
PartialReadSupported indicates whether the TPM character device supports partial reads.
func (*Device) String ¶ added in v1.4.0
String implements fmt.Stringer.
type RMDevice ¶ added in v1.4.0
type RMDevice struct { Device // contains filtered or unexported fields }
RMDevice represents a Linux TPM character device that makes use of the kernel resource manager. It is safe to use this from multiple goroutines simultaneously.
type RawDevice ¶ added in v1.4.0
type RawDevice struct { Device // contains filtered or unexported fields }
RawDevice represents a raw Linux TPM character device. It is safe to use this from multiple goroutines simultaneously.
func DefaultTPM2Device ¶ added in v1.1.0
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. It is safe to call this function from multiple goroutines simultaneously.
func DefaultTPMDevice ¶ added in v1.1.0
DefaultTPMDevice returns the default TPM device. If there are no devices available, then ErrNoTPMDevices is returned. It is safe to call this function from multiple goroutines simultaneously.
func ListTPM2Devices ¶ added in v1.1.0
ListTPMDevices returns a list of all TPM2 devices. It is safe to call this function from multiple goroutines simultaneously.
func ListTPMDevices ¶ added in v1.1.0
ListTPMDevices returns a list of all TPM devices. Note that this returns all devices, regardless of version. It is safe to call this function from multiple goroutines simultaneously.
func (*RawDevice) PhysicalPresenceInterface ¶ added in v1.4.0
PhysicalPresenceInterface returns the physical presence interface associated with this device.
func (*RawDevice) ResourceManagedDevice ¶ added in v1.4.0
ResourceManagedDevice returns the corresponding resource managed device if one is available.
type TPMDeviceRM
deprecated
added in
v1.1.0
type TPMDeviceRaw
deprecated
added in
v1.1.0
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 TctiDevice
deprecated
type TctiDevice = Transport
TctiDevice represents a connection to a Linux TPM character device.
Deprecated: Use Transport
type Transport ¶ added in v1.4.0
type Transport struct {
// contains filtered or unexported fields
}
Transport represents a connection to a Linux TPM character device. It is not intended to be used from multiple goroutines simultaneously.
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 Transport instance which can be passed to tpm2.NewTPMContext. Failure to open the TPM character device will result in a *os.PathError being returned.
func (*Transport) Close ¶ added in v1.4.0
Close implements tpm2.Transport.Close.
func (*Transport) Read ¶ added in v1.4.0
Read implmements tpm2.Transport.