The SSH Public Key Infrastructure
[The libssh API]

Functions for the creation, importation and manipulation of public and private keys in the context of the SSH protocol. More...

Functions

void ssh_key_clean (ssh_key key)
 clean up the key and deallocate all existing keys
void ssh_key_free (ssh_key key)
 deallocate a SSH key
int ssh_key_import_private (ssh_key key, ssh_session session, const char *filename, const char *passphrase)
 import a key from a file
ssh_key ssh_key_new (void)
 creates a new empty SSH key
enum ssh_keytypes_e ssh_key_type (ssh_key key)
 returns the type of a ssh key

Detailed Description

Functions for the creation, importation and manipulation of public and private keys in the context of the SSH protocol.


Function Documentation

void ssh_key_clean ( ssh_key  key  ) 

clean up the key and deallocate all existing keys

Parameters:
[in] key ssh_key to clean

Referenced by ssh_key_free(), and ssh_key_import_private().

void ssh_key_free ( ssh_key  key  ) 

deallocate a SSH key

Parameters:
[in] key ssh_key handle to free

References ssh_key_clean().

int ssh_key_import_private ( ssh_key  key,
ssh_session  session,
const char *  filename,
const char *  passphrase 
)

import a key from a file

Parameters:
[out] key the ssh_key to update
[in] session The SSH Session to use. If a key decryption callback is set, it will be used to ask for the passphrase.
[in] filename The filename of the the private key.
[in] passphrase The passphrase to decrypt the private key. Set to null if none is needed or it is unknown.
Returns:
SSH_OK on success, SSH_ERROR otherwise.

References privatekey_from_file(), and ssh_key_clean().

ssh_key ssh_key_new ( void   ) 

creates a new empty SSH key

Returns:
an empty ssh_key handle, or NULL on error.
enum ssh_keytypes_e ssh_key_type ( ssh_key  key  ) 

returns the type of a ssh key

Parameters:
[in] key the ssh_key handle
Returns:
one of SSH_KEYTYPE_RSA,SSH_KEYTYPE_DSS,SSH_KEYTYPE_RSA1
SSH_KEYTYPE_UNKNOWN if the type is unknown

Generated on 22 Jan 2015 for libssh by  doxygen 1.6.1