added C pk export

This commit is contained in:
TLINDEN
2014-02-13 20:20:50 +01:00
parent 604006994f
commit 5e04147a35
2 changed files with 10 additions and 0 deletions

View File

@@ -415,6 +415,12 @@ void pcp_exportpublic(char *keyid, char *passwd, char *outfile, int format, int
fprintf(out, "%s", buffer_get_str(exported_pk));
}
}
else if(format == EXP_FORMAT_C) {
exported_pk = pcp_export_c_pub(sk);
if(exported_pk != NULL) {
fprintf(out, "%s", buffer_get_str(exported_pk));
}
}
errpcpexpu1:
buffer_free(exported_pk);

View File

@@ -199,6 +199,9 @@ int main (int argc, char **argv) {
else if(strncmp(optarg, "perl", 3) == 0) {
exportformat = EXP_FORMAT_PERL;
}
else if(strncmp(optarg, "c", 3) == 0) {
exportformat = EXP_FORMAT_C;
}
else {
warn("Unknown export format specified, using native\n");
exportformat = EXP_FORMAT_NATIVE;
@@ -587,6 +590,7 @@ int main (int argc, char **argv) {
}
fatals_ifany();
fatals_done();
return PCP_EXIT;
}