legacy-list-mode

Werner Koch wk at gnupg.org
Mon Feb 3 15:17:38 CET 2014


Hi!

we recently talked about how to format a key listing for ECC.  I gave it
a shot and here are some examples:

  $ g10/gpg2 --legacy-list-mode --list-key 1E42B367
  pub   2048D/1E42B367 2007-12-31 [expires: 2018-12-31]
  uid                  Werner Koch <wk at gnupg.org>
  uid                  Werner Koch <wk at g10code.com>
  uid                  Werner Koch <werner at eifzilla.de>
  sub   1024D/77F95F95 2011-11-02
  sub   2048R/664D7444 2014-01-02 [expires: 2016-12-31]

This is bascially how it has been done since PGP-2

  $ g10/gpg2 --list-key 1E42B367
  pub   dsa2048/1E42B367 2007-12-31 [expires: 2018-12-31]
  uid                  Werner Koch <wk at gnupg.org>
  uid                  Werner Koch <wk at g10code.com>
  uid                  Werner Koch <werner at eifzilla.de>
  sub   dsa1024/77F95F95 2011-11-02
  sub   rsa2048/664D7444 2014-01-02 [expires: 2016-12-31]

  $ g10/gpg2  --list-key 658BF9C2
  pub   nistp256/658BF9C2 2013-09-23 nistp256
  uid                  Test for GCRY_PK_ECC change
  sub   nistp256/67F0948F 2013-09-23 nistp256

This is the new format which includes the name of the curves.  The curve
names are longer than what we have now.  We may even see
"brainpoolP256r1/12345678".  Of course could use shorter names but in
any case it will be longer and for unknown curves even much longer (gpg
would print the OID instead of the name)

The problem is that it does not anymore nicely align up in columns.  We
could use some padding to cover the common cases.  However that would
also mean to indent the uid even more.  I don't think that will be a
good idea.   If we could agree on completly departing from the old
format, a format like

  pub   1E42B367 2007-12-31 dsa2948 [expires: 2018-12-31]
  uid            Werner Koch <wk at gnupg.org>
  uid            Werner Koch <wk at g10code.com>
  uid            Werner Koch <werner at eifzilla.de>
  sub   77F95F95 2011-11-02 dsa1024
  sub   664D7444 2014-01-02 rsa2048 [expires: 2016-12-31]

might be better.  Note that we sometimes print strings like "[marginal]"
in front of the UID which won't fit anymore if short keyids are used.
We could of course use abbreviations here:

    [ revoked] => [rev]
    [ expired] => [exp]
    [ unknown] => [ - ]
    [  undef ] => [ / ]
    [marginal] => [mar]
    [  full  ] => [ful]
    [ultimate] => [ult]


To complete the picture, here is how I changed the format used by
--edit-key.  First the old format:

  $ g10/gpg2 --legacy-list-mode --edit-key 1E42B367
  pub  2048D/1E42B367  created: 2007-12-31  expires: 2018-12-31  usage: SC
                       trust: unknown       validity: unknown
  sub  2048R/FA8FE1F9  created: 2008-03-21  expired: 2011-12-30  usage: E
  sub  1024D/77F95F95  created: 2011-11-02  expires: never       usage: S
  sub  2048R/C193565B  created: 2011-11-07  expired: 2013-12-31  usage: E
  sub  2048R/664D7444  created: 2014-01-02  expires: 2016-12-31  usage: E
  [ unknown] (1). Werner Koch <wk at gnupg.org>
  [ unknown] (2)  Werner Koch <wk at g10code.com>
  [ unknown] (3)  Werner Koch <werner at eifzilla.de>

And here is the new one.

  $ g10/gpg2 --edit-key 1E42B367
  pub  dsa2048/1E42B367
       created: 2007-12-31  expires: 2018-12-31  usage: SC
       trust: unknown       validity: unknown
  sub  rsa2048/FA8FE1F9
       created: 2008-03-21  expired: 2011-12-30  usage: E
  sub  dsa1024/77F95F95
       created: 2011-11-02  expires: never       usage: S
  sub  rsa2048/C193565B
       created: 2011-11-07  expired: 2013-12-31  usage: E
  sub  rsa2048/664D7444
       created: 2014-01-02  expires: 2016-12-31  usage: E
  [ unknown] (1). Werner Koch <wk at gnupg.org>
  [ unknown] (2)  Werner Koch <wk at g10code.com>
  [ unknown] (3)  Werner Koch <werner at eifzilla.de>


I am not really satisfied.


Salam-Shalom,

   Werner


--
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gnupg-devel mailing list