Key sent by customer working fine using SFTP command via Putty. It is working fine through Winscp.
But when i try using Java Code then i get following:
Caused by: com.maverick.ssh.SshException:
Failed to negotiate a transport component
[hmac-sha1,hmac-md5] [hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256]
[Unknown cause]
Code :
else if (authMethod == AUTH_KEY) {
PublicKeyAuthentication pk = new PublicKeyAuthentication();
SshPrivateKeyFile pkfile = SshPrivateKeyFileFactory.parse(new FileInputStream(pass));
com.maverick.ssh.components.SshKeyPair pair;
if (pkfile.isPassphraseProtected())
pair = pkfile.toKeyPair(keypass);
else
pair = pkfile.toKeyPair(null);
pk.setPrivateKey(pair.getPrivateKey());
pk.setPublicKey(pair.getPublicKey());
this.session.authenticate(pk);
The above common code is working fine for existing Keys and not for this new server. Not a concrete solution at code level is found.
Any thing more to be added here in code or any type of conversions?