moved key dump functions to the lib

This commit is contained in:
git@daemon.de
2014-02-19 20:38:21 +01:00
parent 080482d1cd
commit 3a4e40710b
2 changed files with 86 additions and 69 deletions

View File

@@ -265,75 +265,6 @@ void pcpkey_print(pcp_key_t *key, FILE* out) {
free(z85encoded);
}
void pcp_dumpkey(pcp_key_t *k) {
int i;
printf("Dumping pcp_key_t raw values:\n");
printf(" public: ");
for ( i = 0;i < 32;++i) printf("%02x",(unsigned int) k->pub[i]);
printf("\n");
printf(" secret: ");
for ( i = 0;i < 32;++i) printf("%02x",(unsigned int) k->secret[i]);
printf("\n");
printf(" edpub: ");
for ( i = 0;i < 32;++i) printf("%02x",(unsigned int) k->edpub[i]);
printf("\n");
printf(" edsecret: ");
for ( i = 0;i < 64;++i) printf("%02x",(unsigned int) k->edsecret[i]);
printf("\n");
printf(" nonce: ");
for ( i = 0;i < 24;++i) printf("%02x",(unsigned int) k->nonce[i]);
printf("\n");
printf("encrypted: ");
for ( i = 0;i < 80;++i) printf("%02x",(unsigned int) k->encrypted[i]);
printf("\n");
printf(" owner: %s\n", k->owner);
printf(" mail: %s\n", k->mail);
printf(" id: %s\n", k->id);
printf(" ctime: %ld\n", (long int)k->ctime);
printf(" version: 0x%08X\n", k->version);
printf(" serial: 0x%08X\n", k->serial);
printf(" type: 0x%02X\n", k->type);
}
void pcp_dumppubkey(pcp_pubkey_t *k) {
int i;
printf("Dumping pcp_pubkey_t raw values:\n");
printf(" public: ");
for ( i = 0;i < 32;++i) printf("%02x",(unsigned int) k->pub[i]);
printf("\n");
printf(" edpub: ");
for ( i = 0;i < 32;++i) printf("%02x",(unsigned int) k->edpub[i]);
printf("\n");
printf(" owner: %s\n", k->owner);
printf(" mail: %s\n", k->mail);
printf(" id: %s\n", k->id);
printf(" ctime: %ld\n", (long int)k->ctime);
printf(" version: 0x%08X\n", k->version);
printf(" serial: 0x%08X\n", k->serial);
printf(" type: 0x%02X\n", k->type);
}
void pcpkey_printshortinfo(pcp_key_t *key) {
int i;