mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-18 12:20:58 +01:00
added yaml and perl pubkey export formats (c and python will follow)
This commit is contained in:
@@ -344,7 +344,7 @@ void pcp_exportpublic(char *keyid, char *passwd, char *outfile, int format, int
|
||||
}
|
||||
|
||||
|
||||
if(is_foreign == 0 && sk->secret[0] == 0) {
|
||||
if(is_foreign == 0 && sk->secret[0] == 0 && format <= EXP_FORMAT_PBP) {
|
||||
/* decrypt the secret key */
|
||||
if(passwd != NULL) {
|
||||
sk = pcpkey_decrypt(sk, passwd);
|
||||
@@ -403,6 +403,18 @@ void pcp_exportpublic(char *keyid, char *passwd, char *outfile, int format, int
|
||||
goto errpcpexpu1;
|
||||
}
|
||||
}
|
||||
else if(format == EXP_FORMAT_YAML) {
|
||||
exported_pk = pcp_export_yaml_pub(sk);
|
||||
if(exported_pk != NULL) {
|
||||
fprintf(out, "%s", buffer_get_str(exported_pk));
|
||||
}
|
||||
}
|
||||
else if(format == EXP_FORMAT_PERL) {
|
||||
exported_pk = pcp_export_perl_pub(sk);
|
||||
if(exported_pk != NULL) {
|
||||
fprintf(out, "%s", buffer_get_str(exported_pk));
|
||||
}
|
||||
}
|
||||
|
||||
errpcpexpu1:
|
||||
buffer_free(exported_pk);
|
||||
|
||||
Reference in New Issue
Block a user