1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-08 19:02:06 +03:00

pki: Make publickey_to_string a legacy function.

This commit is contained in:
Andreas Schneider
2011-08-16 17:54:10 +02:00
parent a40f1d8597
commit 9b84464748
2 changed files with 23 additions and 233 deletions

View File

@@ -381,6 +381,29 @@ ssh_public_key publickey_from_string(ssh_session session, ssh_string pubkey_s) {
return pubkey;
}
ssh_string publickey_to_string(ssh_public_key pubkey) {
ssh_key key;
ssh_string key_blob;
key = ssh_key_new();
if (key == NULL) {
return NULL;
}
key->type = pubkey->type;
key->type_c = pubkey->type_c;
key->dsa = pubkey->dsa_pub;
key->rsa = pubkey->rsa_pub;
key_blob = ssh_pki_publickey_to_blob(key);
key->dsa = NULL;
key->rsa = NULL;
ssh_key_free(key);
return key_blob;
}
/****************************************************************************
* SERVER SUPPORT
****************************************************************************/