util

package
v0.0.65 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package tpm2 provides 1:1 mapping to TPM 2.0 APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CPBytes

func CPBytes[R any](cmd tpm2.Command[R, *R]) ([]byte, error)

CPBytes (tpm2.Policy): Convert a TPM Policy to command bytes

func Marshal

func Marshal(v Marshallable) []byte

Marshal will serialize the given values, returning them as a byte slice.

func ReqParameters

func ReqParameters(parms []byte, rspStruct any) error

ReqParameters convert bytes to a TPM Policy

func ReqParametersPolicySecret

func ReqParametersPolicySecret(parms []byte, rspStruct *tpm2.PolicySecret) (tpm2.PolicySecret, error)

func Unmarshal

func Unmarshal[T Marshallable, P interface {
	*T
	Unmarshallable
}](data []byte) (*T, error)

Unmarshal unmarshals the given type from the byte array. Returns an error if the buffer does not contain enough data to satisfy the types, or if the types are not unmarshallable.

Types

type Marshallable

type Marshallable interface {
	// contains filtered or unexported methods
}

Marshallable represents any TPM type that can be marshalled.

type Unmarshallable

type Unmarshallable interface {
	Marshallable
	// contains filtered or unexported methods
}

Unmarshallable represents any TPM type that can be marshalled or unmarshalled.

Jump to

Keyboard shortcuts

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