tpm

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2015 License: BSD-3-Clause Imports: 4 Imported by: 6

Documentation

Overview

Package tpm wraps the Trousers library for accessing the TPM from user-space. It currently provides very limited functionality: just NVRAM access.

Index

Constants

View Source
const (
	// Failed to connect to daemon process.
	ErrCodeCommunicationFailure ErrorCode = C.TSS_E_COMM_FAILURE
	// The TPM is disabled in the BIOS.
	ErrCodeTPMDisabled = 7
	// The TPM doesn't have an owner and thus no storage root key has been
	// defined.
	ErrCodeNoStorageRootKey = 0x12
	// The NVRAM index already exists.
	ErrCodeNVRAMAlreadyExists = 0x13b
	// The password is incorrect.
	ErrCodeAuthentication = 1
)

Error code values

View Source
const (
	PermAuthRead       = C.TPM_NV_PER_AUTHREAD
	PermAuthWrite      = C.TPM_NV_PER_AUTHWRITE
	PermWriteAllAtOnce = C.TPM_NV_PER_WRITEALL
)

Variables

This section is empty.

Functions

func Present

func Present() bool

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

func NewContext

func NewContext() (*Context, error)

func (*Context) Close

func (c *Context) Close() error

func (*Context) GetPolicy

func (c *Context) GetPolicy() (*Policy, error)

func (*Context) NewNVRAM

func (c *Context) NewNVRAM() (*NVRAM, error)

func (*Context) NewPolicy

func (c *Context) NewPolicy() (*Policy, error)

func (*Context) NewRSA

func (c *Context) NewRSA() (*RSA, error)

func (*Context) TakeOwnership

func (c *Context) TakeOwnership(srk *RSA) error

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (Error) Code

func (e Error) Code() ErrorCode

func (Error) Error

func (e Error) Error() string

type ErrorCode

type ErrorCode int

type NVRAM

type NVRAM struct {
	Object
	Index       uint32
	Size        int
	Permissions uint32
}

func (*NVRAM) Create

func (nv *NVRAM) Create() error

func (*NVRAM) Destroy

func (nv *NVRAM) Destroy() error

func (*NVRAM) Read

func (nv *NVRAM) Read(out []byte) (int, error)

func (*NVRAM) Write

func (nv *NVRAM) Write(contents []byte) error

type Object

type Object struct {
	// contains filtered or unexported fields
}

type Policy

type Policy struct {
	// contains filtered or unexported fields
}

func (*Policy) AssignTo

func (p *Policy) AssignTo(o *Object) error

func (*Policy) SetKey

func (p *Policy) SetKey(key [20]byte) error

func (*Policy) SetPassword

func (p *Policy) SetPassword(pw string) error

type RSA

type RSA struct {
	Object
}

func (*RSA) GetPolicy

func (rsa *RSA) GetPolicy() (*Policy, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL