From 186e07b415b1699be75961d306df369b537da855 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Wed, 28 Apr 2010 11:51:02 +0200 Subject: Added ssh_privatekey_type public function --- libssh/keyfiles.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libssh') diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c index 427087a9..f05cd736 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) { -- cgit v1.2.3