Debian Codegraph @

examples/tpm-sign/README.md

raw
1 # tpm-sign
2
3 This example shows how you can generate keys inside the TPM and use them for signature/verification operations. This utility supports `sign`, `verify`, `generate`, and `extendPcr` actions. Use `./tpm-sign <action> --help` for advanced usage of each action.
4
5 ## Basic Usage
6 The following snippet shows how you can generate a key, sign data with it, and verify the signature.
7
8 ```
9 $ ./tpm-sign generate
10 Writing keyblob to keyblob
11 Writing public key to publickey
12 $ echo test_data | ./tpm-sign sign
13 Writing signature to sig.data
14 $ echo test_data | ./tpm-sign verify
15 Signature valid.
16 ```
17
18 ## Binding against PCRs
19 This example shows how you can generate a key that is bound against PCR values.
20
21 ```
22 $ ./tpm-sign extendPcr --reset --pcr 16
23 $ ./tpm-sign generate --pcrs 0,16
24 Writing keyblob to keyblob
25 Writing public key to publickey
26 $ echo test_data | ./tpm-sign sign
27 Writing signature to sig.data
28 $ echo test_measurement | ./tpm-sign extendPcr --pcr 16
29 $ echo test_data | ./tpm-sign sign
30 Could not perform sign operation: tpm: the named PCR value does not match the current PCR value
31 ```
32