Functions for the creation, importation and manipulation of public and private keys in the context of the SSH protocol.
More...
Functions for the creation, importation and manipulation of public and private keys in the context of the SSH protocol.
void ssh_key_clean |
( |
ssh_key |
key | ) |
|
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