cmd

package module
v0.3.12 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: Apache-2.0, BSD-3-Clause Imports: 23 Imported by: 1

Documentation

Overview

Package cmd contains a CLI to interact with TPM.

Index

Constants

View Source
const (
	// SevSnp is a constant denotes device name for teeTechnology
	SevSnp = "sev-snp"
)

Add constants for other devices when required

Variables

View Source
var ExternalTPM io.ReadWriter

ExternalTPM can be set to run tests against an TPM initialized by an external package (like the simulator). Setting this value will make all gotpm commands run against it, and will prevent the cmd package from closing the TPM. Setting this value and closing the TPM must be managed by the external package. ExternalTPM can have a TPM simulator or a real TPM.

View Source
var RootCmd = &cobra.Command{
	Use: "gotpm",
	Long: `Command line tool for the go-tpm TSS

This tool allows performing TPM2 operations from the command line.
See the per-command documentation for more information.`,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		if quiet && verbose {
			return fmt.Errorf("cannot specify both --quiet and --verbose")
		}
		cmd.SilenceUsage = true
		return nil
	},
}

RootCmd is the entrypoint for gotpm.

Functions

This section is empty.

Types

type Instance added in v0.3.12

type Instance struct {
	ProjectID     string
	ProjectNumber string
	InstanceID    string
	InstanceName  string
	Zone          string
}

Instance struct for supported fake values for metadata server.

type MetadataServer added in v0.3.12

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

MetadataServer provides fake implementation for the GCE metadata server.

func NewMetadataServer added in v0.3.12

func NewMetadataServer(data Instance) (*MetadataServer, error)

NewMetadataServer starts and hooks up a Server, serving env. data is the mock Instance data the metadata server will respond with.

func (*MetadataServer) Stop added in v0.3.12

func (s *MetadataServer) Stop()

Stop shuts down the server and restores original metadataHostEnv env var.

Directories

Path Synopsis
Package main is a binary wrapper package around cmd.
Package main is a binary wrapper package around cmd.

Jump to

Keyboard shortcuts

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