aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-04-28 11:51:02 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-04-28 11:51:42 +0200
commit186e07b415b1699be75961d306df369b537da855 (patch)
tree86614df1bb8240f01d3de592673611bc8cd195a3 /libssh
parent4ab63d3d8c1d0aa9c6833ae17fef9d5b6edcb054 (diff)
downloadlibssh-186e07b415b1699be75961d306df369b537da855.tar.gz
libssh-186e07b415b1699be75961d306df369b537da855.tar.xz
libssh-186e07b415b1699be75961d306df369b537da855.zip
Added ssh_privatekey_type public function
Diffstat (limited to 'libssh')
-rw-r--r--libssh/keyfiles.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c
index 427087a..f05cd73 100644
--- a/libssh/keyfiles.c
+++ b/libssh/keyfiles.c
@@ -796,6 +796,20 @@ ssh_private_key privatekey_from_file(ssh_session session, const char *filename,
return privkey;
}
+/**
+ * @brief returns the type of a private key
+ * @param privatekey[in] the private key handle
+ * @returns one of TYPE_RSA,TYPE_DSS,TYPE_RSA1
+ * @returns 0 if the type is unknown
+ * @see privatekey_from_file
+ * @see ssh_userauth_offer_pubkey
+ */
+int ssh_privatekey_type(ssh_private_key privatekey){
+ if (privatekey==NULL)
+ return 0;
+ return privatekey->type;
+}
+
/* same that privatekey_from_file() but without any passphrase things. */
ssh_private_key _privatekey_from_file(void *session, const char *filename,
int type) {