tpm2-software / tpm2-totp

Attest the trustworthiness of a device against a human using time-based one-time passwords
https://tpm2-software.github.io
BSD 3-Clause "New" or "Revised" License
163 stars 36 forks source link

doc: generate tpm2-totp(3) man page with doxygen #42

Closed diabonas closed 5 years ago

diabonas commented 5 years ago

Generate a tpm2-totp(3) man page using doxygen. The generated man page looks like this:

Click to view the full man page NAME ==== tpm2-totp SYNOPSIS ======== Functions --------- int **tpm2totp\_generateKey** (uint32\_t pcrs, uint32\_t banks, const char \*password, TSS2\_TCTI\_CONTEXT \*tcti\_context, uint8\_t \*\*secret, size\_t \*secret\_size, uint8\_t \*\*keyBlob, size\_t \*keyBlob\_size) int **tpm2totp\_reseal** (const uint8\_t \*keyBlob, size\_t keyBlob\_size, const char \*password, uint32\_t pcrs, uint32\_t banks, TSS2\_TCTI\_CONTEXT \*tcti\_context, uint8\_t \*\*newBlob, size\_t \*newBlob\_size) int **tpm2totp\_storeKey\_nv** (const uint8\_t \*keyBlob, size\_t keyBlob\_size, uint32\_t nv, TSS2\_TCTI\_CONTEXT \*tcti\_context) int **tpm2totp\_loadKey\_nv** (uint32\_t nv, TSS2\_TCTI\_CONTEXT \*tcti\_context, uint8\_t \*\*keyBlob, size\_t \*keyBlob\_size) int **tpm2totp\_deleteKey\_nv** (uint32\_t nv, TSS2\_TCTI\_CONTEXT \*tcti\_context) int **tpm2totp\_calculate** (const uint8\_t \*keyBlob, size\_t keyBlob\_size, TSS2\_TCTI\_CONTEXT \*tcti\_context, time\_t \*nowp, uint64\_t \*otp) int **tpm2totp\_getSecret** (const uint8\_t \*keyBlob, size\_t keyBlob\_size, const char \*password, TSS2\_TCTI\_CONTEXT \*tcti\_context, uint8\_t \*\*secret, size\_t \*secret\_size) Detailed Description ==================== Attest the trustworthiness of a device against a human using time-based one-time passwords. Function Documentation ====================== int tpm2totp\_calculate (const uint8\_t \* keyBlob, size\_t keyBlob\_size, TSS2\_TCTI\_CONTEXT \* tcti\_context, time\_t \* nowp, uint64\_t \* otp) --------------------------------------------------------------------------------------------------------------------------------------------------- Calculate a time-based one-time password for a key. **Parameters:** > *keyBlob* Key to generate the TOTP. > *keyBlob\_size* Size of the key. > *tcti\_context* Optional TCTI context to select TPM to use. > *nowp* Current time. > *otp* Calculated TOTP. **Return values:** > *0* on success. > *-1* on undefined/general failure. int tpm2totp\_deleteKey\_nv (uint32\_t nv, TSS2\_TCTI\_CONTEXT \* tcti\_context) -------------------------------------------------------------------------------- Delete a key from a NV index. **Parameters:** > *nv* NV index to delete. > *tcti\_context* Optional TCTI context to select TPM to use. **Return values:** > *0* on success. > *-1* on undefined/general failure. int tpm2totp\_generateKey (uint32\_t pcrs, uint32\_t banks, const char \* password, TSS2\_TCTI\_CONTEXT \* tcti\_context, uint8\_t \*\* secret, size\_t \* secret\_size, uint8\_t \*\* keyBlob, size\_t \* keyBlob\_size) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Generate a key. **Parameters:** > *pcrs* PCRs the key should be sealed against. > *banks* PCR banks the key should be sealed against. > *password* Optional password to recover or reseal the secret. > *tcti\_context* Optional TCTI context to select TPM to use. > *secret* Generated secret. > *secret\_size* Size of the secret. > *keyBlob* Generated key. > *keyBlob\_size* Size of the generated key. **Return values:** > *0* on success. > *-1* on undefined/general failure. int tpm2totp\_getSecret (const uint8\_t \* keyBlob, size\_t keyBlob\_size, const char \* password, TSS2\_TCTI\_CONTEXT \* tcti\_context, uint8\_t \*\* secret, size\_t \* secret\_size) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Recover a secret from a key. **Parameters:** > *keyBlob* Key to recover the secret from. > *keyBlob\_size* Size of the key. > *password* Password of the key. > *tcti\_context* Optional TCTI context to select TPM to use. > *secret* Recovered secret. > *secret\_size* Size of the secret. **Return values:** > *0* on success. > *-1* on undefined/general failure. > *-10* on empty password. int tpm2totp\_loadKey\_nv (uint32\_t nv, TSS2\_TCTI\_CONTEXT \* tcti\_context, uint8\_t \*\* keyBlob, size\_t \* keyBlob\_size) ------------------------------------------------------------------------------------------------------------------------------- Load a key from a NV index. **Parameters:** > *nv* NV index of the key. > *tcti\_context* Optional TCTI context to select TPM to use. > *keyBlob* Loaded key. > *keyBlob\_size* Size of the key. **Return values:** > *0* on success. > *-1* on undefined/general failure. int tpm2totp\_reseal (const uint8\_t \* keyBlob, size\_t keyBlob\_size, const char \* password, uint32\_t pcrs, uint32\_t banks, TSS2\_TCTI\_CONTEXT \* tcti\_context, uint8\_t \*\* newBlob, size\_t \* newBlob\_size) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Reseal a key to new PCR values. **Parameters:** > *keyBlob* Original key. > *keyBlob\_size* Size of the key. > *password* Password of the key. > *pcrs* PCRs the key should be sealed against. > *banks* PCR banks the key should be sealed against. > *tcti\_context* Optional TCTI context to select TPM to use. > *newBlob* New key. > *newBlob\_size* Size of the new key. **Return values:** > *0* on success. > *-1* on undefined/general failure. > *-10* on empty password. int tpm2totp\_storeKey\_nv (const uint8\_t \* keyBlob, size\_t keyBlob\_size, uint32\_t nv, TSS2\_TCTI\_CONTEXT \* tcti\_context) --------------------------------------------------------------------------------------------------------------------------------- Store a key in a NV index. **Parameters:** > *keyBlob* Key to store to NVRAM. > *keyBlob\_size* Size of the key. > *nv* NV index to store the key. > *tcti\_context* Optional TCTI context to select TPM to use. **Return values:** > *0* on success. > *-1* on undefined/general failure. Author ====== Generated automatically by Doxygen for tpm2-totp from the source code.

The generated man page is included in distributions so that doxygen doesn't need to be available when installing from a source tarball.

The Doxyfile was generated using doxygen -g Doxyfile.in, the differences to the template (as displayed by doxygen -x Doxyfile.in) are as follows:

# Difference with default Doxyfile 1.8.15
PROJECT_NAME           = @PACKAGE_NAME@
PROJECT_NUMBER         = @VERSION@
PROJECT_BRIEF          = "Attest the trustworthiness of a device against a human using time-based one-time passwords"
OUTPUT_DIRECTORY       = @top_builddir@/doxygen-doc
OPTIMIZE_OUTPUT_FOR_C  = YES
QUIET                  = YES
WARN_NO_PARAMDOC       = YES
INPUT                  = @top_srcdir@/src/libtpm2-totp.c
GENERATE_HTML          = NO
GENERATE_LATEX         = NO
GENERATE_MAN           = YES

Closes: #22