Re: [JSch-users] [solved] jsch-0.1.54.jar throws com.jcraft.jsch.JSchException: invalid privatekey
Status: Alpha
Brought to you by:
ymnk
From: Erik W. <eri...@na...> - 2016-11-08 20:21:41
|
On 08.11.2016 06:39, Tim Bain wrote: > This is the 0.1.53 source: > http://grepcode.com/file/repo1.maven.org/maven2/com.jcraft/jsch/0.1.53/com/jcraft/jsch/KeyPair.java#KeyPair > Presumably the 0.1.54 source isn't much different, since the line > numbers match exactly. > > Look at lines 634-665, and in particular lines 638-644. It looks like > keys in formats DSA, RSA, ECDSA, and SSH are supported, but there's no > indication that OPENSSH keys are supported. Did you maybe forget the > "-t rsa" argument when generating the 4096-bit key? I'm not sure why > the output would include "(RSA)" if that happened, but at the same time > the content you showed us doesn't appear to be an RSA key... Hi. Thanks for the answer. You've pushed me into the right direction. I've just recreated a new key with the following command: > ssh-keygen -b 4096 -f .ssh/foo And everything is fine and the first line indicates an RSA. And voilà: Jsch is working just fine with a 4096 bits/RSA key. So my key was just bad, like the error messages indicated it. B-) Thanks for the help. -- So long... Erik |