|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jcraft.jsch.JSch
public class JSch
| Field Summary | |
|---|---|
static String |
VERSION
The version number. |
| Constructor Summary | |
|---|---|
JSch()
|
|
| Method Summary | |
|---|---|
void |
addIdentity(Identity identity,
byte[] passphrase)
Sets the private key, which will be referred in the public key authentication. |
void |
addIdentity(String prvkey)
Sets the private key, which will be referred in the public key authentication. |
void |
addIdentity(String prvkey,
byte[] passphrase)
Sets the private key, which will be referred in the public key authentication. |
void |
addIdentity(String name,
byte[] prvkey,
byte[] pubkey,
byte[] passphrase)
Sets the private key, which will be referred in the public key authentication. |
void |
addIdentity(String prvkey,
String passphrase)
Sets the private key, which will be referred in the public key authentication. |
void |
addIdentity(String prvkey,
String pubkey,
byte[] passphrase)
Sets the private key, which will be referred in the public key authentication. |
protected void |
addSession(Session session)
|
static String |
getConfig(String key)
Returns the config value for the specified key. |
ConfigRepository |
getConfigRepository()
|
HostKeyRepository |
getHostKeyRepository()
Returns the current hostkey repository. |
Vector |
getIdentityNames()
Lists names of identities included in the identityRepository. |
IdentityRepository |
getIdentityRepository()
|
Session |
getSession(String host)
Instantiates the Session object with
host. |
Session |
getSession(String username,
String host)
Instantiates the Session object with
username and host. |
Session |
getSession(String username,
String host,
int port)
Instantiates the Session object with given
username, host and port. |
void |
removeAllIdentity()
Removes all identities from identityRepository. |
void |
removeIdentity(Identity identity)
Removes the identity from identityRepository. |
void |
removeIdentity(String name)
Deprecated. use #removeIdentity(Identity identity) |
protected boolean |
removeSession(Session session)
|
static void |
setConfig(Hashtable newconf)
Sets or Overrides the configuration. |
static void |
setConfig(String key,
String value)
Sets or Overrides the configuration. |
void |
setConfigRepository(ConfigRepository configRepository)
|
void |
setHostKeyRepository(HostKeyRepository hkrepo)
Sets the hostkey repository. |
void |
setIdentityRepository(IdentityRepository identityRepository)
Sets the identityRepository, which will be referred
in the public key authentication. |
void |
setKnownHosts(InputStream stream)
Sets the instance of KnownHosts generated with
stream. |
void |
setKnownHosts(String filename)
Sets the instance of KnownHosts, which refers
to filename. |
static void |
setLogger(Logger logger)
Sets the logger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String VERSION
| Constructor Detail |
|---|
public JSch()
| Method Detail |
|---|
public void setIdentityRepository(IdentityRepository identityRepository)
identityRepository, which will be referred
in the public key authentication.
identityRepository - if null is given,
the default repository, which usually refers to ~/.ssh/, will be used.getIdentityRepository()public IdentityRepository getIdentityRepository()
public ConfigRepository getConfigRepository()
public void setConfigRepository(ConfigRepository configRepository)
public Session getSession(String host)
throws JSchException
Session object with
host. The user name and port number will be retrieved from
ConfigRepository. If user name is not given,
the system property "user.name" will be referred.
host - hostname
Session class.
JSchException - if username or host are invalid.getSession(String username, String host, int port),
Session,
ConfigRepository
public Session getSession(String username,
String host)
throws JSchException
Session object with
username and host.
The TCP port 22 will be used in making the connection.
Note that the TCP connection must not be established
until Session#connect().
username - user namehost - hostname
Session class.
JSchException - if username or host are invalid.getSession(String username, String host, int port),
Session
public Session getSession(String username,
String host,
int port)
throws JSchException
Session object with given
username, host and port.
Note that the TCP connection must not be established
until Session#connect().
username - user namehost - hostnameport - port number
Session class.
JSchException - if username or host are invalid.getSession(String username, String host, int port),
Sessionprotected void addSession(Session session)
protected boolean removeSession(Session session)
public void setHostKeyRepository(HostKeyRepository hkrepo)
hkrepo - HostKeyRepository,
KnownHosts
public void setKnownHosts(String filename)
throws JSchException
KnownHosts, which refers
to filename.
filename - filename of known_hosts file.
JSchException - if the given filename is invalid.KnownHosts
public void setKnownHosts(InputStream stream)
throws JSchException
KnownHosts generated with
stream.
stream - the instance of InputStream from known_hosts file.
JSchException - if an I/O error occurs.KnownHostspublic HostKeyRepository getHostKeyRepository()
KnownHosts.
HostKeyRepository,
KnownHosts
public void addIdentity(String prvkey)
throws JSchException
prvkey - filename of the private key.
JSchException - if prvkey is invalid.addIdentity(String prvkey, String passphrase)
public void addIdentity(String prvkey,
String passphrase)
throws JSchException
passphrase.
prvkey - filename of the private key.passphrase - passphrase for prvkey.
JSchException - if passphrase is not right.addIdentity(String prvkey, byte[] passphrase)
public void addIdentity(String prvkey,
byte[] passphrase)
throws JSchException
passphrase.
prvkey - filename of the private key.passphrase - passphrase for prvkey.
JSchException - if passphrase is not right.addIdentity(String prvkey, String pubkey, byte[] passphrase)
public void addIdentity(String prvkey,
String pubkey,
byte[] passphrase)
throws JSchException
passphrase.
prvkey - filename of the private key.pubkey - filename of the public key.passphrase - passphrase for prvkey.
JSchException - if passphrase is not right.
public void addIdentity(String name,
byte[] prvkey,
byte[] pubkey,
byte[] passphrase)
throws JSchException
passphrase.
name - name of the identity to be used to
retrieve it in the identityRepository.prvkey - private key in byte array.pubkey - public key in byte array.passphrase - passphrase for prvkey.
JSchException
public void addIdentity(Identity identity,
byte[] passphrase)
throws JSchException
passphrase.
identity - private key.passphrase - passphrase for identity.
JSchException - if passphrase is not right.
public void removeIdentity(String name)
throws JSchException
JSchException
public void removeIdentity(Identity identity)
throws JSchException
identity - the indentity to be removed.
JSchException - if identity is invalid.
public Vector getIdentityNames()
throws JSchException
JSchException - if identityReposory has problems.
public void removeAllIdentity()
throws JSchException
JSchException - if identityReposory has problems.public static String getConfig(String key)
key - key for the configuration.
public static void setConfig(Hashtable newconf)
newconf - configurations
public static void setConfig(String key,
String value)
key - key for the configurationvalue - value for the configurationpublic static void setLogger(Logger logger)
logger - loggerLogger
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||