gettime.sh 363 B

1234567891011121314151617181920
  1. # SPDX-License-Identifier: BSD-3-Clause
  2. source helpers.sh
  3. cleanup() {
  4. rm -f attest.sig attest.data
  5. }
  6. trap cleanup EXIT
  7. start_up
  8. tpm2 createprimary -C e -c primary.ctx
  9. tpm2 create -G rsa -u rsa.pub -r rsa.priv -C primary.ctx
  10. tpm2 load -C primary.ctx -u rsa.pub -r rsa.priv -c rsa.ctx
  11. tpm2 gettime -c rsa.ctx -o attest.sig --attestation attest.data
  12. exit 0