Skip to content

Commit

Permalink
tpm_createek: Fix man page example.
Browse files Browse the repository at this point in the history
The last example does not work if a resource manager is used.
Thus the option -Tdevice:/dev/tpm0 is added to the commands.

Signed-off-by: Juergen Repp <juergen_repp@web.de>
  • Loading branch information
JuergenReppSIT committed Sep 25, 2023
1 parent e7526e1 commit 1d93d03
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions man/tpm2_createek.1.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% tpm2_createek(1) tpm2-tools | General Commands Manual

# NAME

https://www.aka55plus.de/materialien/Programm_35.pdf
**tpm2_createek**(1) - Generate TCG profile compliant endorsement key.

# SYNOPSIS
Expand Down Expand Up @@ -93,25 +93,30 @@ tpm2_createek -G ecc384 -c 0x81010002
```

### Create a transient Endorsement Key, flush it, and reload it.
Typically, when using the TPM, the interactions occur through a resource
manager, like tpm2-abrmd(8). However, when interacting with the TPM directly,
this scenario is possible. The below example assumes direct TPM access not
brokered by a resource manager. Specifically we will use /dev/tpm0.

```bash
tpm2_createek -c ek.ctx -G rsa -u ek.pub
tpm2_createek -c ek.ctx -G rsa -u ek.pub -Tdevice:/dev/tpm0

# Check that it is loaded in transient memory
tpm2_getcap handles-transient
tpm2_getcap handles-transient -Tdevice:/dev/tpm0
- 0x80000000

# Flush the handle
tpm2_flushcontext 0x80000000
tpm2_flushcontext 0x80000000 -Tdevice:/dev/tpm0

# Note that it is flushed
tpm2_getcap handles-transient
tpm2_getcap handles-transient -Tdevice:/dev/tpm0
<null output>

# Reload it via loadexternal
tpm2_loadexternal -C o -u ek.pub -c ek.ctx
tpm2_loadexternal -C o -u ek.pub -c ek.ctx -Tdevice:/dev/tpm0

# Check that it is re-loaded in transient memory
tpm2_getcap handles-transient
tpm2_getcap handles-transient -Tdevice:/dev/tpm0
- 0x80000000

```
Expand Down

0 comments on commit 1d93d03

Please sign in to comment.