Hi, +-From: Jochen Wierum <[email protected]> -- |_Date: Wed, 24 Oct 2012 12:02:47 +0200 _________ | | This worked fine until newer Versions of jsch |(perhaps it worked until 0.1.48, I don't know when I tested it the last |time). I am able to load private keys, but I can't unload them again. ... | final String keyfile = "/tmp/ssh/id_rsa"; | final com.jcraft.jsch.JSch jsch = new com.jcraft.jsch.JSch(); | jsch.addIdentity(keyfile); | jsch.removeIdentity(keyfile); | System.out.println(jsch.getIdentityNames().size()); // 1
Is "/tmp/ssh/id_rsa" a cyphered private key? If so, try jsch.addIdentity(keyfile, "passphrase"); or locate its public-key file as "/tmp/ssh/id_rsa.pub". JSch has been designed to work with jsch-agent-proxy[1], and identities may be stored in ssh-agent or Pageant. So, to remove an identity from them, we need to use its public-key blob. Unfortunately, we can not get the public-key blob from the cyphered private key file in OpenSSH format. Off the topic, if that file is in the Putty's format, your code will work even if it is cyphered, becase Putty's private key includes the public-key blob always. [1] http://www.jcraft.com/jsch-agent-proxy/ Sincerely, -- Atsuhiko Yamanaka JCraft,Inc. 1-14-20 HONCHO AOBA-KU, SENDAI, MIYAGI 980-0014 Japan. Tel +81-22-723-2150 Skype callto://jcraft/ Twitter: http://twitter.com/ymnk Facebook: http://facebook.com/aymnk ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ JSch-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jsch-users
