14 changes: 8 additions & 6 deletions Makefile.am
Expand Up @@ -238,15 +238,9 @@ man1_MANS = \
man/man1/tpm2_pcrlist.1 \
man/man1/tpm2_quote.1 \
man/man1/tpm2_takeownership.1 \
man/man1/tpm2_makecredential.1 \
man/man1/tpm2_nvlist.1 \
man/man1/tpm2_nvread.1 \
man/man1/tpm2_nvreadlock.1 \
man/man1/tpm2_nvwrite.1 \
man/man1/tpm2_nvdefine.1 \
man/man1/tpm2_nvrelease.1 \
man/man1/tpm2_readpublic.1 \
man/man1/tpm2_loadexternal.1 \
man/man1/tpm2_rsadecrypt.1 \
man/man1/tpm2_rsaencrypt.1 \
man/man1/tpm2_sign.1 \
Expand Down Expand Up @@ -275,6 +269,12 @@ if HAVE_MD2MAN_ROFF
man/man1/tpm2_hmac.1 \
man/man1/tpm2_listpersistent.1 \
man/man1/tpm2_load.1 \
man/man1/tpm2_loadexternal.1 \
man/man1/tpm2_makecredential.1 \
man/man1/tpm2_nvdefine.1 \
man/man1/tpm2_nvlist.1 \
man/man1/tpm2_nvread.1 \
man/man1/tpm2_nvreadlock.1 \
man/man1/tpm2_pcrevent.1
endif

Expand Down Expand Up @@ -340,6 +340,8 @@ man/man1/%.1 : man/%.1.md $(MARKDOWN_COMMON_DEPS)
-e '/\[supported public object algorithms\]/d' \
-e '/\[supported signing algorithms\]/r man/common/sign-alg.md' \
-e '/\[supported signing algorithms\]/d' \
-e '/\[nv attributes\]/r man/common/nv-attrs.md' \
-e '/\[nv attributes\]/d' \
< $< | md2man-roff > $@

CLEANFILES = $(man1_MANS)
20 changes: 20 additions & 0 deletions man/common/nv-attrs.md
@@ -0,0 +1,20 @@
NV Attributes
-------------

NV Attributes are used to control various properties of the NV defined space.
When specified as an option, either the raw bitfield mask or "nice-names" may be
used. The values can be found in Table 204 Part 2 of the TPM2.0 specification,
which can be found here:

<https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf>

Nice names are calculated by taking the name field of table 204 and removing the
prefix `TPMA_NV_` and lowercasing the result. Thus, `TPMA_NV_PPWRITE` becomes
ppwrite. Nice names can be joined using the bitwise or "|" symbol.

Note that the `TPM_NT` field is 4 bits wide, and thus can be set via
`nt=<num>` format. For instance, to set The fields `TPMA_NV_OWNERREAD`,
`TPMA_NV_OWNERWRITE`, `TPMA_NV_POLICYWRITE`, and `TPMA_NT = 0x3`, the argument
would be:

`ownerread|ownerwrite|policywrite|nt=0x3`
69 changes: 0 additions & 69 deletions man/tpm2_loadexternal.1.in

This file was deleted.

72 changes: 72 additions & 0 deletions man/tpm2_loadexternal.1.md
@@ -0,0 +1,72 @@
tpm2_loadexternal 1 "SEPTEMBER 2017" tpm2-tools
==================================================

NAME
----

tpm2_loadexternal(1) - load an object that is not a Protected Object into the
TPM.

SYNOPSIS
--------

`tpm2_loadexternal` [OPTIONS]

DESCRIPTION
-----------

tpm2_loadexternal(1) - load an object that is not a Protected Object into the
TPM. The command allows loading of a public area or both a public and a
sensitive area.

OPTIONS
-------

* `-H`, `--hierarchy`=_HIERARCHY_:
hierarchy to use for the ticket.
Supported options are:
* `o` for `TPM_RH_OWNER`
* `p` for `TPM_RH_PLATFORM`
* `e` for `TPM_RH_ENDORSEMENT`
* `n` for `TPM_RH_NULL`

* `-u`, `--pubfile`=_PUBLIC\_FILE_:
The public portion of the object.

* `-r`, `--privfile`=_PRIVATE\_FILE_:
The sensitive portion of the object, optional.

* `-C`, `--context`=_CONTEXT\_FILE_
The file to save the object context, optional.

[common options](common/options.md)

[common tcti options](common/tcti.md)

EXAMPLES
--------

Load a public area generated by tpm2_create, tpm2_readpublic or manually

```
tpm2_loadexternal -H <e|o|p|n> -u <pubKeyFileName> -C object.context
```

Load a key with sensitive area. Both the public & the senstive areas shall
be generated externally. *DON'T* use the areas generated by tpm2_create.

```
tpm2_loadexternal -H n -u <pubKeyFileName> -r <privKeyFileName> -C object.context
```

RETURNS
-------
0 on success or 1 on failure.

BUGS
----
[Github Issues](https://github.com/01org/tpm2-tools/issues)

HELP
----
See the [Mailing List](https://lists.01.org/mailman/listinfo/tpm2)
65 changes: 0 additions & 65 deletions man/tpm2_makecredential.1.in

This file was deleted.

58 changes: 58 additions & 0 deletions man/tpm2_makecredential.1.md
@@ -0,0 +1,58 @@
tpm2_makecredential 1 "SEPTEMBER 2017" tpm2-tools
==================================================

NAME
----

tpm2_makecredential(1) - load an object that is not a Protected Object into the
TPM.

SYNOPSIS
--------

`tpm2_makecredential` [OPTIONS]

DESCRIPTION
-----------

tpm2_makecredential(1) - Use a TPM public key to protect a secret that is used
to encrypt the AK certififcate.

OPTIONS
-------

* `-e`, `--enckey`=_PUBLIC\_FILE_:
A tpm Public Key which was used to wrap the seed.

* `-s`, `--sec`=_SECRET\_DATA\_FILE_:
The secret which will be protected by the key derived from the random seed.

* `-n`, `--name`=_NAME_
The name of the key for which certificate is to be created.

* `-o`, `--outFile`=_OUT\_FILE_
The output file path, recording the two structures output by
tpm2_makecredential function.

[common options](common/options.md)

[common tcti options](common/tcti.md)

EXAMPLES
--------

```
tpm2_makecredential -e <keyFile> -s <secFile> -n <hexString> -o <outFile>
```

RETURNS
-------
0 on success or 1 on failure.

BUGS
----
[Github Issues](https://github.com/01org/tpm2-tools/issues)

HELP
----
See the [Mailing List](https://lists.01.org/mailman/listinfo/tpm2)