Documentation Index
Fetch the complete documentation index at: https://dylankenneally-react-native-ssh-sftp-96.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Connection Factory Methods
connectWithPassword
Connects to an SSH server using password authentication.Parameters
The hostname or IP address of the SSH server.
The port number of the SSH server (typically 22).
The username for authentication.
The password for authentication.
Optional callback function to handle any errors during the connection process.
Returns
A Promise that resolves to an instance of
SSHClient if the connection is successful.Example
connectWithKey
Connects to an SSH server using a private key for authentication.Parameters
The hostname or IP address of the SSH server.
The port number of the SSH server (typically 22).
The username for authentication.
The private key for authentication in PEM format.
The passphrase for the private key (optional). Required if the private key is encrypted.
A callback function to handle the connection result (optional).
Returns
A Promise that resolves to an instance of
SSHClient if the connection is successful. Otherwise, it rejects with an error.Example
Key Management Methods
generateKeyPair
Generates a new SSH key pair for authentication.Parameters
The type of key to generate (e.g., ‘rsa’, ‘ed25519’, ‘ecdsa’).
Optional passphrase to encrypt the private key.
Optional key size in bits (e.g., 2048, 4096 for RSA). Defaults vary by key type.
Optional comment to include with the key pair.
Returns
A Promise that resolves to an object containing the generated key pair.
Example
getKeyDetails
Retrieves the details of an SSH private key.Parameters
The SSH private key as a string in PEM format.
Returns
A Promise that resolves to the details of the key.Properties:
keyType(string): The type of the key (e.g., ‘RSA’, ‘ED25519’, ‘ECDSA’)keySize(number): The size of the key in bits