tpm_utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const EK_CERT_INDEX = 0x01C00002
View Source
const TPM_PATH = "/dev/tpm0"

Variables

This section is empty.

Functions

func DecCredAES

func DecCredAES(srcA, srcC, secret, iv []byte) ([]byte, []byte, error)

func EncCredAES

func EncCredAES(srcA, srcC, secret, iv []byte) ([]byte, []byte, error)

func MakeCred

func MakeCred(aik *legacy.HashValue, pub crypto.PublicKey, symBlockSize int, secret []byte) ([]byte, []byte, error)

*

  • this function is copied from go-tpm/legacy/tpm2/credactivation/credactivation.go

Types

type PublicParams

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

type TPM

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

func OpenTPM

func OpenTPM(password []byte, path string) (*TPM, error)

func (*TPM) ActivateCredential

func (tpm *TPM) ActivateCredential(ekHandle *tpm2.AuthHandle, srkHandle *tpm2.NamedHandle, idObject, wrappedCredential []byte) ([]byte, error)

func (*TPM) Close

func (tpm *TPM) Close()

func (*TPM) Commit

func (tpm *TPM) Commit(handle *tpm2.AuthHandle, P1_ECP *FP256BN.ECP, S2_bytes []byte, P2 *FP256BN.ECP) (*tpm2.CommitResponse, *FP256BN.ECP, *FP256BN.ECP, *FP256BN.ECP, error)

func (*TPM) CreateKey

func (tpm *TPM) CreateKey() (*tpm2.AuthHandle, *tpm2.AuthHandle, *tpm2.NamedHandle, *tpm2.TPM2BPublic, error)

func (*TPM) ReadEKCert

func (tpm *TPM) ReadEKCert() (*x509.Certificate, error)

func (*TPM) Sign

func (tpm *TPM) Sign(digest []byte, count uint16, handle *tpm2.AuthHandle) (*tpm2.SignResponse, *FP256BN.BIG, *FP256BN.BIG, error)

Jump to

Keyboard shortcuts

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