Documentation ¶
Index ¶
- type Command
- func (cmd Command) Description() string
- func (cmd Command) DumpRequestFormat() (DumpFormat, error)
- func (cmd Command) EventLog() (*tpmeventlog.TPMEventLog, error)
- func (cmd Command) Execute(ctx context.Context, cfg commands.Config, args []string) error
- func (cmd Command) ExpectPCR0() ([]byte, bool, error)
- func (cmd Command) FirmwareVersion(ctx context.Context, actualFirmware []byte, ...) ([]afas.FirmwareVersion, error)
- func (cmd Command) FirmwarewandOptions() []firmwarewand.Option
- func (cmd Command) FlagFlow() (pcr.Flow, error)
- func (cmd Command) FlagUseRequest(ctx context.Context) (*afas.AnalyzeRequest, error)
- func (cmd Command) OutputTemplate() (*template.Template, error)
- func (cmd Command) Registers() (registers.Registers, bool, error)
- func (cmd *Command) SetupFlagSet(flag *flag.FlagSet)
- func (cmd Command) TPMDevice() (tpmdetection.Type, bool, error)
- func (cmd Command) Usage() string
- type DumpFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command is the implementation of `commands.Command`.
func (Command) Description ¶
Description explains what this verb commands to do
func (Command) DumpRequestFormat ¶
func (cmd Command) DumpRequestFormat() (DumpFormat, error)
DumpRequestFormat returns required Analyze request dump format or an error
func (Command) EventLog ¶
func (cmd Command) EventLog() (*tpmeventlog.TPMEventLog, error)
EventLog returns a parsed TPM Event Log defined by path through flag '-event-log'.
func (Command) Execute ¶
Execute is the main function here. It is responsible to start the execution of the command.
`args` are the arguments left unused by verb itself and options.
func (Command) ExpectPCR0 ¶
ExpectPCR0 returns a PCR0 defined by path flag '-expect-pcr0' and '-localhost'
func (Command) FirmwareVersion ¶
func (cmd Command) FirmwareVersion(ctx context.Context, actualFirmware []byte, actualImageMetaData *afas.FirmwareImageMetadata) ([]afas.FirmwareVersion, error)
FirmwareVersion returns information about firmware version based on flags '-firmware-version' and '-localhost' as well as optional input args
func (Command) FirmwarewandOptions ¶
func (cmd Command) FirmwarewandOptions() []firmwarewand.Option
FirmwarewandOptions returns firmwarewand.Option slice which should be used according to passed flags.
func (Command) FlagUseRequest ¶
FlagUseRequest parses the file defined in `-use-request` as the AnalyzeRequest to be sent. Returns nil (without error) if the flag is empty. TODO: consider splitting `analyze` to `scan` and `analyze`
func (Command) OutputTemplate ¶
OutputTemplate returns the template for output (or nil if it is not set).
func (Command) Registers ¶
Registers returns status registers according to flag '-registers' and '-localhost'
func (*Command) SetupFlagSet ¶
SetupFlagSet is called to allow the command implementation to setup which option flags it has.
type DumpFormat ¶
type DumpFormat string
DumpFormat specifies dump options
const ( // DumpFormatNone means do not dump DumpFormatNone DumpFormat = "" // DumpFormatJSON means to dump in json format DumpFormatJSON DumpFormat = "json" // DumpFormatBinary means to dump in binary (base64 encoded) format DumpFormatBinary DumpFormat = "binary" )