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

examples to use duplicate and rewrite #8

Closed
PunyHunter opened this issue Sep 20, 2023 · 4 comments
Closed

examples to use duplicate and rewrite #8

PunyHunter opened this issue Sep 20, 2023 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@PunyHunter
Copy link

Can you provide examples to use duplicate and rewrite, TCG's documentation is difficult to understand, or can you provide some website addresses where there are examples

@PunyHunter
Copy link
Author

Thank you very much

@kgoldman
Copy link
Owner

See regtests/testdup.sh for several examples of duplicate and rewrap. I assume you mean rewrap, not rewrite.

My development process is:

  • find a test script that's close to my use case
  • cut and paste from the script to replicate my use case
  • cut and paste C code from the command line programs into my program
    For a complicated program, you can replace the script a few lines at a time to help debug

Ask again if something isn't clear.

@kgoldman kgoldman self-assigned this Sep 20, 2023
@kgoldman kgoldman added the question Further information is requested label Sep 20, 2023
@PunyHunter
Copy link
Author

Thanks for your answer.I followed the example(Rewrap) and still couldn't run rewrap and reported some errors.I also don't understand why there are three TPMs. Doesn't "rewrap" only require two TPMs? My background is that there is a KEY under a primary key of TPM1. How to migrate it to a primary key of TPM2? Thank you!

@kgoldman
Copy link
Owner

kgoldman commented Sep 26, 2023

  1. It is important to report what the rewrap error was. 'some errors' is insufficient.

  2. Read Part 1 Rewrap to see why it uses three TPMs - the source, the recovery service, and the destination.

  3. If you have a key K1 on TPM1 and a storage parent S2 on TPM2, duplicate K1 to S2 public key on TPM1, then import K1 to S2 private key on TPM2.
    It does not matter whether the storage parents are primary keys or not.

In the test scripts, see testdup.sh "Duplicate Child Key"

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

No branches or pull requests

2 participants