mwiede / jsch

fork of the popular jsch library
Other
718 stars 133 forks source link

failed to parse public key error with successful connection #489

Closed a-tinker closed 8 months ago

a-tinker commented 8 months ago

I am able to establish successful connection and then receiving "failed to parse public key" error with following stack trace: failed to parse public key java.lang.ArrayIndexOutOfBoundsException: 0 at com.jcraft.jsch.KeyPair.load(KeyPair.java:1015) at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:44) at com.jcraft.jsch.JSch.addIdentity(JSch.java:524) at

norrisjeremy commented 8 months ago

Hi @a-tinker,

The byte[] pubkey argument you are passing to the JSch.addIdentity() would appear to be an empty array instead of a an actual ssh public key string.

Thanks, Jeremy

a-tinker commented 8 months ago

Thanks Jeremy. It has helped and resolved.

a-tinker commented 8 months ago

Resolved