Documentation ¶
Index ¶
- Variables
- func CancelCommands(ctx uintptr) error
- func CloseContext(ctx uintptr) error
- func CreateContext(version uint32, attr Attribute) (uintptr, error)
- func CreateWindowsKey(kh uint32) error
- func GetDeviceId() ([]byte, error)
- func GetOwnerAuth(ctx uintptr, oaType OwnerAuthType) ([]byte, error)
- func GetTCGLog() ([]byte, error)
- func GetTCGLogEx(logType LogType) ([]byte, error)
- func PhysicalPresenceCommand(ctx uintptr, command, out []byte) (uint32, error)
- func RevokeAttestation() error
- func SubmitCommand(ctx uintptr, priority Priority, command, out []byte) (uint32, error)
- func SubmitCommandDirect(ctx uintptr, command, out []byte) (uint32, error)
- func SubmitCommandNonBlocking(ctx uintptr, priority Priority, command, out []byte) (uint32, error)
- type Attribute
- type Locality
- type LogType
- type OwnerAuthType
- type Priority
- type TpmDeviceInfo
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidContext = errors.New("the specified context handle does not refer to a valid context") ErrTpmDeviceNotFound = errors.New("a compatible TPM Security Device cannot be found on this computer") )
Functions ¶
func CancelCommands ¶
CancelCommands cancels all outstanding commands for the specified context.
func CloseContext ¶
CloseContext closes a context handle, which releases resources associated with the context in TBS and closes the binding handle used to communicate with TBS.
func CreateContext ¶
CreateContext creates a context handle that can be used to pass commands to TBS.
func CreateWindowsKey ¶
func GetDeviceId ¶
func GetOwnerAuth ¶
func GetOwnerAuth(ctx uintptr, oaType OwnerAuthType) ([]byte, error)
GetOwnerAuth retrieves the owner authorization of the TPM if the information is available in the local registry.
Only TPM2.0 or later is supported. Root privileges are required for execution.
func GetTCGLog ¶
GetTCGLog Retrieves the most recent Windows Boot Configuration Log (WBCL), also referred to as a TCG log.
func GetTCGLogEx ¶
GetTCGLogEx gets the Windows Boot Configuration Log (WBCL), also referred to as the TCG log, of the specified type.
func PhysicalPresenceCommand ¶
PhysicalPresenceCommand passes a physical presence ACPI command through TBS to the driver.
func RevokeAttestation ¶
func RevokeAttestation() error
RevokeAttestation invalidates the PCRs if the ELAM driver detects a policy-violation (a rootkit, for example).
func SubmitCommand ¶
SubmitCommand submits a Trusted Platform Module (TPM) command to TPM Base Services (TBS) for processing.
func SubmitCommandDirect ¶ added in v0.3.0
Types ¶
type LogType ¶
type LogType uint32
const ( LogTypeSRTMCurrent LogType = iota // log associated with the current session (boot or resume) LogTypeDRTMCurrent // log associated with the current session (boot or resume) LogTypeSRTMBoot // log associated with the most recent clean boot (SRTM log) LogTypeSRTMResume // log associated with the current resume from hibernation (SRTM log) LogTypeDRTMBoot // log associated with the most recent clean boot (DRTM log) LogTypeDRTMResume // log associated with the current resume from hibernation (DRTM log) )
type OwnerAuthType ¶
type OwnerAuthType uint32
const ( OwnerAuthTypeFull OwnerAuthType = 1 OwnerAuthTypeEndorsement20 OwnerAuthType = 12 OwnerAuthTypeEndorsementStorage20 OwnerAuthType = 13 )
type TpmDeviceInfo ¶
type TpmDeviceInfo struct { StructVersion uint32 Version uint32 InterFaceType uint32 ImpRevision uint32 }
func GetDeviceInfo ¶
func GetDeviceInfo() (*TpmDeviceInfo, error)
GetDeviceInfo obtains the version of the TPM on the computer.