Categorygithub.com/foxboron/swtpm_test
modulepackage
0.0.0-20230726224112-46aaafdf7006
Repository: https://github.com/foxboron/swtpm_test.git
Documentation: pkg.go.dev

# README

swtpm_test

Small library to setup a user-accessible swtpm instance.

Usefull for writing test-suites that involves TPMs.

func main() {
	dir, err := os.MkdirTemp("/var/tmp", "example")
	if err != nil {
		log.Fatal(err)
	}
	defer os.RemoveAll(dir) // clean up

	tpm := swtpm.NewSwtpm(dir)
	socket, err := tpm.Socket()
	if err != nil {
		log.Fatal("failed socket", err)
	}
	defer tpm.Stop()

	if _, err := tpm2.OpenTPM(socket); err != nil {
		log.Fatal(err)
	}
}

# Functions

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author