google / google/go-tpm

Example for storing & fetching string/bytes ?

Open
#164 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
673
Forks
188
PR merge metrics
No merged PRs in 30d

Description

Hi,
I'd like to use this library to fetch a master key out of the TPM chip.
This master key should only be available to my Go program.

Is there a best practice example I could use for this use case?
Altough this seems like a typical scenario, I am having issues grasping the API.
Would I...
0. take ownership of the TPM using owner & srk secrets via `TakeOwnership`
https://github.com/google/go-tpm/blob/master/examples/tpm-takeownership/own.go

1. first open TPM chip using `OpenTPM`
2. clear an address space using `NVDefineSpace`
3. write the master key using `NVWrite`
4. read out the master key using `NVRead`

If so, what defines the owner, handle and authString?

Contributor guide

Open the contributing guide

Research direction

Start with examples/tpm-takeownership/own.go and the issue's listed OpenTPM, TakeOwnership, NVDefineSpace, NVWrite, and NVRead APIs. The issue does not name a target file or test, so first clarify the supported ownership, handle, and authorization flow. Done would be a reviewed, secure example covering the requested string/bytes storage and fetching workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
documentation, security
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.