tpm2_listpersistent: improve the tool output
tpm2_listpersistent: improve the tool output

The tool output was far from ideal, it was neither easy for other tools
to parse nor human readable. So convert to a better format that is also
aligned with what other tpm2-tools print, for example tpm2_pcrlist.

Old outout:

2 persistent objects defined.

  0. Persistent handle: 0x81010000
  {
        Type: 0x1
        Hash algorithm(nameAlg): 0xb
        Attributes: 0x30072
  }

  1. Persistent handle: 0x81020000
  {
        Type: 0x23
        Hash algorithm(nameAlg): 0xb
        Attributes: 0x30072
  }

New output:

persistent-handle[0]:0x81010000 key-alg:rsa hash-alg:sha256 object-attr:0x30072
persistent-handle[1]:0x81020000 key-alg:ecc hash-alg:sha256 object-attr:0x30072

Suggested-by: William Roberts <60148e894dabf0b83bde1d460768794cd453c455@intel.com>
Signed-off-by: Javier Martinez Canillas <8fdf2abf85d34ea8f3f979ef25dc1f25d94aca29@redhat.com>

01org/tpm2.0-tools,martinezjavier/tpm2-tools,martinezjavier/tpm2-tools,01org/tpm2.0-tools,martinezjavier/tpm2-tools,martinezjavier/tpm2-tools,01org/tpm2.0-tools