diff options
author | Werner Koch <[email protected]> | 1999-06-08 11:41:46 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 1999-06-08 11:41:46 +0000 |
commit | 40238d4b63b409d716d1e105c999725e8a7beedc (patch) | |
tree | 55ddfe3d43fa2704761ee3c5a54138101002d591 /g10 | |
parent | See ChangeLog: Sat Jun 5 15:30:33 CEST 1999 Werner Koch (diff) | |
download | gnupg-40238d4b63b409d716d1e105c999725e8a7beedc.tar.gz gnupg-40238d4b63b409d716d1e105c999725e8a7beedc.zip |
See ChangeLog: Tue Jun 8 13:36:25 CEST 1999 Werner Koch
Diffstat (limited to 'g10')
-rw-r--r-- | g10/ChangeLog | 5 | ||||
-rw-r--r-- | g10/g10.c | 3 | ||||
-rw-r--r-- | g10/keylist.c | 18 | ||||
-rw-r--r-- | g10/options.h | 1 |
4 files changed, 27 insertions, 0 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index a66b8af38..53870b45f 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,8 @@ +Tue Jun 8 13:36:25 CEST 1999 Werner Koch <[email protected]> + + * keylist.c (print_key_data): New and called elsewhere. + * g10.c: New option --with-key-data + Wed Jun 2 14:17:19 CEST 1999 Werner Koch <[email protected]> * mainproc.c (proc_tree): Yet another bad hack to cope with @@ -136,6 +136,7 @@ enum cmd_and_opt_values { aNull = 0, oNoBatch, oHomedir, oWithColons, + oWithKeyData, oSkipVerify, oCompressKeys, oCompressSigs, @@ -285,6 +286,7 @@ static ARGPARSE_OPTS opts[] = { { oHomedir, "homedir", 2, "@" }, /* defaults to "~/.gnupg" */ { oNoBatch, "no-batch", 0, "@" }, { oWithColons, "with-colons", 0, "@"}, + { oWithKeyData,"with-key-data", 0, "@"}, { aListKeys, "list-key", 0, "@" }, /* alias */ { aListSigs, "list-sig", 0, "@" }, /* alias */ { aCheckKeys, "check-sig",0, "@" }, /* alias */ @@ -693,6 +695,7 @@ main( int argc, char **argv ) case oNoOptions: break; /* no-options */ case oHomedir: opt.homedir = pargs.r.ret_str; break; case oNoBatch: opt.batch = 0; break; + case oWithKeyData: opt.with_key_data=1; /* fall thru */ case oWithColons: opt.with_colons=':'; break; case oSkipVerify: opt.skip_verify=1; break; diff --git a/g10/keylist.c b/g10/keylist.c index cfd6772c0..02a265394 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -152,6 +152,20 @@ list_one( STRLIST names, int secret ) } } +static void +print_key_data( PKT_public_key *pk, u32 *keyid ) +{ + int n = pubkey_get_npkey( pk->pubkey_algo ); + int i; + + for(i=0; i < n; i++ ) { + printf("pkd:%d:%u:", i, mpi_get_nbits( pk->pkey[i] ) ); + mpi_print(stdout, pk->pkey[i], 1 ); + putchar(':'); + putchar('\n'); + } +} + static void list_keyblock( KBNODE keyblock, int secret ) @@ -249,6 +263,8 @@ list_keyblock( KBNODE keyblock, int secret ) if( !any ) { if( opt.fingerprint ) fingerprint( pk, sk ); + if( opt.with_key_data ) + print_key_data( pk, keyid ); any = 1; } } @@ -289,6 +305,8 @@ list_keyblock( KBNODE keyblock, int secret ) datestr_from_pk( pk2 ) ); if( opt.fingerprint > 1 ) fingerprint( pk2, NULL ); + if( opt.with_key_data ) + print_key_data( pk2, keyid2 ); } else if( node->pkt->pkttype == PKT_SECRET_SUBKEY ) { u32 keyid2[2]; diff --git a/g10/options.h b/g10/options.h index 57265f9e4..ff477dfcf 100644 --- a/g10/options.h +++ b/g10/options.h @@ -39,6 +39,7 @@ struct { int answer_no; /* answer no on most questions */ int check_sigs; /* check key signatures */ int with_colons; + int with_key_data; int fingerprint; /* list fingerprints */ int list_sigs; /* list signatures */ int no_armor; |