I have created a SSH key in my local host in another user login (Instead of root user). The public (id_rsa.pub) and private (id_rsa) key files in the directory (/home/user/.ssh/). I have copied the public key file to the remote host in the directory (./ssh/authorized_keys). Passphrase is empty.
I have written a java program to connect to the remote host (linux machine) from my local host (linux machine) using maverick-legacy-client-1.7.5-all.jar classes.
Following is my code block
com.maverick.ssh.PublicKeyAuthentication pubKey = new com.maverick.ssh.PublicKeyAuthentication();
pubKey.setUsername(userName);
SshPrivateKeyFile pkf = SshPrivateKeyFileFactory.parse(privateKey);
SshKeyPair pair = pkf.toKeyPair(passphrase);
But While running the program, I am facing the following issue
com.sshtools.publickey.InvalidPassphraseException: Unsupported type: OPENSSH PRIVATE KEY at com.sshtools.publickey.OpenSSHPrivateKeyFile.toKeyPair(OpenSSHPrivateKeyFile.java:88) ~[maverick-legacy-client-1.7.5-all.jar:?]
I didn't get any clue why this issue is happening.. Please help me to resolve this issue.