Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow persistence client.Key() #349

Open
salrashid123 opened this issue Aug 25, 2023 · 1 comment
Open

Allow persistence client.Key() #349

salrashid123 opened this issue Aug 25, 2023 · 1 comment

Comments

@salrashid123
Copy link

FR to allow client.Key full persistence such that can be loadable after power cycles.

Right now the only way to reuse objects across reboots is to evictcontrol() and find one of the empty slots.

Key.read()
Key.write()

so that the library can load the entire chain cleanly.

also see

google/go-tpm#342

@salrashid123
Copy link
Author

salrashid123 commented Oct 23, 2023

if using tpm2_tools, it should be the something like if using ek

tpm2 flushcontext -t
tpm2 startauthsession --session session.ctx --policy-session
tpm2 policysecret --session session.ctx --object-context endorsement
$ ls
rsa.priv  rsa.pub
tpm2 createek --ek-context ek.ctx
tpm2_load -C ek.ctx -c rsa.ctx -u rsa.pub -r rsa.priv --auth session:session.ctx
tpm2_sign -c rsa.ctx -g sha256  -f plain -p testpassword -o sig.rss  file.txt

there's also the tree to account for since a Key object can be chained/leaf

update:

i ended up parsing improtblob , importing it and then persisting th pub, priv parts to files. then reload the whole context:

https://github.com/salrashid123/gcp_tpm_sealed_keys/tree/main#sealed-asymmetric-key-with-persistent-files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant