libssh  0.5.4
Functions
The SSH Public Key Infrastructure

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 More...
 
void ssh_key_free (ssh_key key)
 deallocate a SSH key More...
 
int ssh_key_import_private (ssh_key key, ssh_session session, const char *filename, const char *passphrase)
 import a key from a file More...
 
ssh_key ssh_key_new (void)
 creates a new empty SSH key More...
 
enum ssh_keytypes_e ssh_key_type (ssh_key key)
 returns the type of a ssh key More...
 

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]keyssh_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]keyssh_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]keythe ssh_key to update
[in]sessionThe SSH Session to use. If a key decryption callback is set, it will be used to ask for the passphrase.
[in]filenameThe filename of the the private key.
[in]passphraseThe 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]keythe ssh_key handle
Returns
one of SSH_KEYTYPE_RSA,SSH_KEYTYPE_DSS,SSH_KEYTYPE_RSA1
SSH_KEYTYPE_UNKNOWN if the type is unknown