Changeset 566

Show
Ignore:
Timestamp:
06/30/08 14:00:12
Author:
rachel
Message:

More concise listing for secret keyring.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openpgpsdk/trunk/include/openpgpsdk/std_print.h

    r558 r566  
    1616 
    1717void ops_print_public_keydata_verbose(const ops_keydata_t *key); 
    18 void ops_print_public_key_t(const ops_public_key_t *pkey); 
     18void ops_print_public_key(const ops_public_key_t *pkey); 
    1919 
    2020void ops_print_secret_keydata(const ops_keydata_t *key); 
    2121void ops_print_secret_keydata_verbose(const ops_keydata_t *key); 
    22 void ops_print_secret_key(const ops_content_tag_t type, const ops_secret_key_t* skey); 
     22//void ops_print_secret_key(const ops_content_tag_t type, const ops_secret_key_t* skey); 
    2323int ops_print_packet(const ops_parser_content_t *content_); 
    2424#endif 
  • openpgpsdk/trunk/src/lib/adv_create.c

    r563 r566  
    493493        fprintf(stderr,"\n"); 
    494494 
    495         ops_print_secret_key(OPS_PTAG_CT_SECRET_KEY,key); 
     495        //ops_print_secret_key(OPS_PTAG_CT_SECRET_KEY,key); 
    496496 
    497497        fprintf(stderr,"turning encryption on...\n"); 
  • openpgpsdk/trunk/src/lib/adv_packet-parse.c

    r565 r566  
    20172017        { 
    20182018        fprintf(stderr,"parse_secret_key: public key parsed\n"); 
    2019         ops_print_public_key_t(&C.secret_key.public_key); 
     2019        ops_print_public_key(&C.secret_key.public_key); 
    20202020        } 
    20212021 
     
    22442244        { 
    22452245        fprintf(stderr,"4 MPIs read\n"); 
    2246         ops_print_secret_key(OPS_PTAG_CT_SECRET_KEY, &C.secret_key); 
     2246        //        ops_print_secret_key_verbose(OPS_PTAG_CT_SECRET_KEY, &C.secret_key); 
    22472247        } 
    22482248 
  • openpgpsdk/trunk/src/lib/std_print.c

    r558 r566  
    8787 
    8888void  
    89 ops_print_public_key_t(const ops_public_key_t *pkey) 
     89ops_print_public_key(const ops_public_key_t *pkey) 
    9090    { 
    9191    printf("------- PUBLIC KEY ------\n"); 
     
    141141    const ops_public_key_t* pkey=&key->key.pkey; 
    142142 
    143     ops_print_public_key_t(pkey); 
    144     /* 
    145     print_unsigned_int("Version",pkey->version); 
    146     print_time("Creation Time", pkey->creation_time); 
    147     if(pkey->version == OPS_V3) 
    148         print_unsigned_int("Days Valid",pkey->days_valid); 
    149  
    150     print_string_and_value("Algorithm",ops_show_pka(pkey->algorithm), 
    151                            pkey->algorithm); 
    152  
    153     switch(pkey->algorithm) 
    154         { 
    155     case OPS_PKA_DSA: 
    156         print_bn("p",pkey->key.dsa.p); 
    157         print_bn("q",pkey->key.dsa.q); 
    158         print_bn("g",pkey->key.dsa.g); 
    159         print_bn("y",pkey->key.dsa.y); 
    160         break; 
    161  
    162     case OPS_PKA_RSA: 
    163     case OPS_PKA_RSA_ENCRYPT_ONLY: 
    164     case OPS_PKA_RSA_SIGN_ONLY: 
    165         print_bn("n",pkey->key.rsa.n); 
    166         print_bn("e",pkey->key.rsa.e); 
    167         break; 
    168  
    169     case OPS_PKA_ELGAMAL: 
    170     case OPS_PKA_ELGAMAL_ENCRYPT_OR_SIGN: 
    171         print_bn("p",pkey->key.elgamal.p); 
    172         print_bn("g",pkey->key.elgamal.g); 
    173         print_bn("y",pkey->key.elgamal.y); 
    174         break; 
    175  
    176     default: 
    177         assert(0); 
    178         } 
    179     */ 
     143    ops_print_public_key(pkey); 
    180144    } 
    181145 
     
    188152*/ 
    189153 
     154void 
     155ops_print_secret_keydata(const ops_keydata_t *key) 
     156    { 
     157    printf("sec "); 
     158    ops_show_pka(key->key.pkey.algorithm); 
     159    printf(" "); 
     160 
     161    hexdump(key->key_id, OPS_KEY_ID_SIZE); 
     162    printf(" "); 
     163 
     164    print_time_short(key->key.pkey.creation_time); 
     165    printf(" "); 
     166 
     167    if (key->nuids==1) 
     168        { 
     169        // print on same line as other info 
     170        printf ("%s\n", key->uids[0].user_id); 
     171        } 
     172    else 
     173        { 
     174        // print all uids on separate line  
     175        unsigned int i; 
     176        printf("\n"); 
     177        for (i=0; i<key->nuids; i++) 
     178            { 
     179            printf("uid                              %s\n",key->uids[i].user_id); 
     180            } 
     181        } 
     182    } 
     183 
     184/* 
    190185void  
    191 ops_print_secret_keydata(const ops_keydata_t* key) 
    192     { 
    193     const ops_secret_key_t* skey=&key->key.skey; 
     186ops_print_secret_key_verbose(const ops_secret_key_t* skey) 
     187    { 
    194188    if(key->type == OPS_PTAG_CT_SECRET_KEY) 
    195189        print_tagname("SECRET_KEY"); 
    196190    else 
    197191        print_tagname("ENCRYPTED_SECRET_KEY"); 
    198     ops_print_public_keydata(key); 
    199192    ops_print_secret_key(key->type,skey); 
    200193        } 
     194*/ 
    201195 
    202196void  
    203 ops_print_secret_key(const ops_content_tag_t type, const ops_secret_key_t* skey) 
     197ops_print_secret_key_verbose(const ops_content_tag_t type, const ops_secret_key_t* skey) 
    204198    { 
    205199    printf("------- SECRET KEY or ENCRYPTED SECRET KEY ------\n"); 
     
    251245 
    252246    printf("------- end of SECRET KEY or ENCRYPTED SECRET KEY ------\n"); 
     247    } 
     248 
     249void 
     250ops_print_secret_keydata_verbose(const ops_keydata_t *key) 
     251    { 
     252    const ops_secret_key_t* skey=&key->key.skey; 
     253    ops_print_public_keydata(key); 
     254    ops_print_secret_key_verbose(key->type,skey); 
    253255    } 
    254256