key: flesh out to use KEYLIST's output XML.
authorW. Trevor King <wking@tremily.us>
Sat, 6 Oct 2012 14:47:52 +0000 (10:47 -0400)
committerW. Trevor King <wking@tremily.us>
Sat, 6 Oct 2012 15:09:22 +0000 (11:09 -0400)
commit1048b3045526d355ac0314597cc98713874b4e5d
treec1f24ce3018d57b51ad68a728f422f9844ef6716
parentf2cc283617bf18efa1c817c64239984b26c2e2dc
key: flesh out to use KEYLIST's output XML.

Since GPGME commit

  commit 3d69b51f7f083193db28f364da4590c33b5e44e6
  Author: W. Trevor King <wking@tremily.us>
  Date:   Fri Sep 28 08:31:13 2012 +0200

    gpgme-tool: Return more detailed XML from KEYLIST

and my two subsequent patches (not yet accepted upstream)

  gpgme-tool: Fix chain_id -> chain-id in KEYLIST XML. [1]
  gpgme-tool: escape special characters in output XML data
    (<, >, and &). [2]

The new KEYLIST output looks like this:

  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <gpgme>
    <keylist>
      <key>
        <revoked value="0x0" />
        <expired value="0x0" />
        <disabled value="0x0" />
        <invalid value="0x0" />
        <can-encrypt value="0x1" />
        <can-sign value="0x1" />
        <can-certify value="0x1" />
        <can-authenticate value="0x0" />
        <is-qualified value="0x0" />
        <secret value="0x0" />
        <protocol value="0">OpenPGP</protocol>
        <issuer>
          <serial></serial>
          <name></name>
        </issuer>
        <chain-id></chain-id>
        <owner-trust value="0">unknown</owner-trust>
        <subkeys>
          <subkey>
            <fpr>B2EDBE0E771A4B8708DD16A7511AEDA64332B6E3</fpr>
          </subkey>
          <subkey>
            <fpr>DECC812C8795ADD60538B0CD171008BA2F73DE2E</fpr>
          </subkey>
        </subkeys>
        <uids>
          <uid>
            <uid>pgp-mime-test (http://blog.tremily.us/posts/pgp-mime/) &lt;pgp-mime@invalid.com&gt;</uid>
            <name>pgp-mime-test</name>
            <email>pgp-mime@invalid.com</email>
            <comment>http://blog.tremily.us/posts/pgp-mime/</comment>
          </uid>
        </uids>
      </key>
    </keylist>
  </gpgme>

[1]: http://article.gmane.org/gmane.comp.encryption.gpg.devel/17151
[2]: http://article.gmane.org/gmane.comp.encryption.gpg.devel/17152

Signed-off-by: W. Trevor King <wking@tremily.us>
pgp_mime/key.py