tpm2

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TPM2

type TPM2 struct {
	tokenutil.TokenParams `json:"-" mapstructure:"-" structs:"-"`

	// Name is the name of trusted domain.
	Name string `json:"-" mapstructure:"-" structs:"-"`

	// TOTPSecret is the secret used to generate initial TOTP codes.
	TOTPSecret string `json:"totp_secret" mapstructure:"totp_secret" structs:"totp_secret"`

	// AKPublic is the public part of the attestation key used to generate
	// TPM 2.0 attestations/quotes.
	AKPublic types.Bytes `json:"tpm2_ak_public" mapstructure:"tpm2_ak_public" structs:"tpm2_ak_public"`

	// AKPrivateBlob is the binary blob that is used to re-load the attestation
	// key into TPM so that required attestation/quote can be generated.
	AKPrivateBlob types.Bytes `json:"-" mapstructure:"-" structs:"-"`

	// PCRs is the slice with expected values of SHA256 Platform Configuration
	// Registers.
	PCRs [24]*types.Byte32 `json:"tpm2_pcrs,omitempty" mapstructure:"-" structs:"-"`
}

func FromPlatform

func FromPlatform() (*TPM2, error)

FromPlatform creates new TPM2 instance from the parameters of the platform we are currently running on.

func (*TPM2) AttestationType

func (td *TPM2) AttestationType() string

func (*TPM2) GetName

func (td *TPM2) GetName() string

func (*TPM2) GetTOTPSecret

func (td *TPM2) GetTOTPSecret() string

func (*TPM2) MatchesAttestation

func (td *TPM2) MatchesAttestation(attestation *attest.PlatformParameters) (
	[]error, []error,
)

func (*TPM2) SetTOTPSecret

func (td *TPM2) SetTOTPSecret(totpSecret string)

Jump to

Keyboard shortcuts

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