Description
This function lists SSH keys.
Warning:
We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
keys |
string |
The SSH key's filename. |
A valid string. Note: You cannot use the following names:
|
user |
pub |
Boolean |
Whether to retrieve public or private keys. If you do not use this parameter, the function returns keys of both types. |
|
0 |
types |
string |
The authorization type. If you do not use this parameter, the function returns keys of both types. |
|
rsa |
Returns
Return |
Type |
Description |
Possible values |
Example |
ctime |
integer |
The key's creation time. |
A datestamp in Unix time format. |
1413917052 |
mtime |
integer |
The key's last modification time. |
A datestamp in Unix time format. |
1413917052 |
file |
string |
The full file path to the key. |
A valid file path. |
zuul |
name |
string |
The SSH key's name. |
A valid filename. |
zuul |
haspub |
Boolean |
Whether the private key has a matching public key. |
|
1 |
key |
string |
The SSH key's filename. |
A string that contains the fingerprint and file location. |
user.pub |
auth |
Boolean |
Whether the key is authorized. |
|
0 |
authaction |
Boolean |
The key's authentication actions. |
|
null |
authstatus |
Boolean |
The key's authorization status. |
|
0 |
status |
string |
The SSH key's status. |
|
authorized |
reason |
string |
A reason for failure. Note: This function only returns a reasonvalue if it failed. |
A string that describes the error. |
This is an error message. |
result |
Boolean |
Whether the function succeeded. |
|
1 |