summaryrefslogtreecommitdiffstats
path: root/src/pki.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-08-15 18:47:18 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-08-15 18:48:08 +0200
commit6ffee224486500ef3f01f7812d5b9c84f5b1aac4 (patch)
treea9a001f18c0b232cf7a11c56e8b01809a40e4d98 /src/pki.c
parentfe375132c33cbfd3ec6cbfdde35efe5439dbbdbb (diff)
downloadlibssh-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.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/pki.c b/src/pki.c
index 004f2db..6883a21 100644
--- a/src/pki.c
+++ b/src/pki.c
@@ -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);
}
/*