See ChangeLog: Wed Sep 15 16:22:17 CEST 1999 Werner Koch
[gnupg.git] / g10 / keylist.c
index cfd6772..91a13af 100644 (file)
@@ -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 )
@@ -241,14 +255,21 @@ list_keyblock( KBNODE keyblock, int secret )
                else
                    printf("uid%*s", 28, "");
            }
-           print_string( stdout,  node->pkt->pkt.user_id->name,
-                         node->pkt->pkt.user_id->len, opt.with_colons );
-           if( opt.with_colons )
+           if( opt.with_colons ) {
+               print_string( stdout,  node->pkt->pkt.user_id->name,
+                             node->pkt->pkt.user_id->len, ':' );
                putchar(':');
+           }
+           else
+               print_utf8_string( stdout,  node->pkt->pkt.user_id->name,
+                                  node->pkt->pkt.user_id->len );
+
            putchar('\n');
            if( !any ) {
                if( opt.fingerprint )
                    fingerprint( pk, sk );
+               if( opt.with_key_data )
+                   print_key_data( pk, keyid );
                any = 1;
            }
        }
@@ -289,6 +310,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];
@@ -384,7 +407,10 @@ list_keyblock( KBNODE keyblock, int secret )
            else {
                size_t n;
                char *p = get_user_id( sig->keyid, &n );
-               print_string( stdout, p, n, opt.with_colons );
+               if( opt.with_colons )
+                   print_string( stdout, p, n, ':' );
+               else
+                   print_utf8_string( stdout, p, n );
                m_free(p);
            }
            if( opt.with_colons )