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

pki: Add ssh_pki_publickey_to_string().

This commit is contained in:
Andreas Schneider
2011-08-15 18:47:18 +02:00
parent fe375132c3
commit 6ffee22448
4 changed files with 249 additions and 21 deletions

View File

@@ -609,13 +609,21 @@ ssh_key ssh_pki_publickey_from_privatekey(const ssh_key privkey) {
return pki_key_dup(privkey, 1);
}
int ssh_pki_publickey_to_string(const ssh_key key, ssh_string *pstr)
/**
* @brief Create a ssh string from a public key.
*
* @param[in] key A public or private key to create the public ssh_string
* from.
*
* @return The string or NULL on error.
*/
ssh_string ssh_pki_publickey_to_string(const ssh_key key)
{
if (key == NULL || pstr == NULL) {
return SSH_ERROR;
if (key == NULL) {
return NULL;
}
return pki_publickey_to_string(key, pstr);
return pki_publickey_to_string(key);
}
/*