Documentation ¶
Overview ¶
Package tpm2 provides 1:1 mapping to TPM 2.0 APIs.
Index ¶
- func CPBytes[R any](cmd tpm2.Command[R, *R]) ([]byte, error)
- func Marshal(v Marshallable) []byte
- func ReqParameters(parms []byte, rspStruct any) error
- func ReqParametersPolicySecret(parms []byte, rspStruct *tpm2.PolicySecret) (tpm2.PolicySecret, error)
- func Unmarshal[T Marshallable, P interface{ ... }](data []byte) (*T, error)
- type Marshallable
- type Unmarshallable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
func Marshal(v Marshallable) []byte
Marshal will serialize the given values, returning them as a byte slice.
func ReqParameters ¶
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.
Click to show internal directories.
Click to hide internal directories.