diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-08-15 18:47:18 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-08-15 18:48:08 +0200 |
commit | 6ffee224486500ef3f01f7812d5b9c84f5b1aac4 (patch) | |
tree | a9a001f18c0b232cf7a11c56e8b01809a40e4d98 /src/pki.c | |
parent | fe375132c33cbfd3ec6cbfdde35efe5439dbbdbb (diff) | |
download | libssh-6ffee224486500ef3f01f7812d5b9c84f5b1aac4.tar.gz libssh-6ffee224486500ef3f01f7812d5b9c84f5b1aac4.tar.xz libssh-6ffee224486500ef3f01f7812d5b9c84f5b1aac4.zip |
pki: Add ssh_pki_publickey_to_string().
Diffstat (limited to 'src/pki.c')
-rw-r--r-- | src/pki.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -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); } /* |