Examples of addIdentity()


Examples of com.jcraft.jsch.JSch.addIdentity()

            final File privateKeyFile = new File(sshDir, "id_rsa");
            if (privateKeyFile.isFile() && privateKeyFile.canRead())
            {
                try
                {
                    jsch.addIdentity(privateKeyFile.getAbsolutePath());
                }
                catch (final JSchException e)
                {
                    throw new FileSystemException("vfs.provider.sftp/load-private-key.error", privateKeyFile, e);
                }
View Full Code Here

Examples of com.jcraft.jsch.JSch.addIdentity()

        String privateKeyFile = getConfiguration().getPrivateKeyFile();
        if (isNotNullAndNonEmpty(privateKeyFile)) {
            log.debug("Using private keyfile: " + privateKeyFile);
            String privateKeyFilePassphrase = getConfiguration().getPrivateKeyFilePassphrase();
            if (isNotNullAndNonEmpty(privateKeyFilePassphrase)) {
                jsch.addIdentity(privateKeyFile, privateKeyFilePassphrase);
            } else {
                jsch.addIdentity(privateKeyFile);
            }
        }
View Full Code Here

Examples of com.jcraft.jsch.JSch.addIdentity()

            log.debug("Using private keyfile: " + privateKeyFile);
            String privateKeyFilePassphrase = getConfiguration().getPrivateKeyFilePassphrase();
            if (isNotNullAndNonEmpty(privateKeyFilePassphrase)) {
                jsch.addIdentity(privateKeyFile, privateKeyFilePassphrase);
            } else {
                jsch.addIdentity(privateKeyFile);
            }
        }

        String knownHostsFile = getConfiguration().getKnownHosts();
        if (isNotNullAndNonEmpty(knownHostsFile)) {
View Full Code Here

Examples of com.jcraft.jsch.JSch.addIdentity()

                JSch.setConfig(ciphers);
            }
            if (ObjectHelper.isNotEmpty(config.getPrivateKeyFile())) {
                LOG.debug("Using private keyfile: {}", config.getPrivateKeyFile());
                if (ObjectHelper.isNotEmpty(config.getPrivateKeyFilePassphrase())) {
                    jsch.addIdentity(config.getPrivateKeyFile(), config.getPrivateKeyFilePassphrase());
                } else {
                    jsch.addIdentity(config.getPrivateKeyFile());
                }
            }
View Full Code Here

Examples of com.jcraft.jsch.JSch.addIdentity()

            if (ObjectHelper.isNotEmpty(config.getPrivateKeyFile())) {
                LOG.debug("Using private keyfile: {}", config.getPrivateKeyFile());
                if (ObjectHelper.isNotEmpty(config.getPrivateKeyFilePassphrase())) {
                    jsch.addIdentity(config.getPrivateKeyFile(), config.getPrivateKeyFilePassphrase());
                } else {
                    jsch.addIdentity(config.getPrivateKeyFile());
                }
            }

            String knownHostsFile = config.getKnownHostsFile();
            jsch.setKnownHosts(ObjectHelper.isEmpty(knownHostsFile) ? DEFAULT_KNOWN_HOSTS : knownHostsFile);
View Full Code Here

Examples of com.jcraft.jsch.JSch.addIdentity()

        }
       
        if (isNotEmpty(sftpConfig.getPrivateKeyFile())) {
            LOG.debug("Using private keyfile: {}", sftpConfig.getPrivateKeyFile());
            if (isNotEmpty(sftpConfig.getPrivateKeyFilePassphrase())) {
                jsch.addIdentity(sftpConfig.getPrivateKeyFile(), sftpConfig.getPrivateKeyFilePassphrase());
            } else {
                jsch.addIdentity(sftpConfig.getPrivateKeyFile());
            }
        }
View Full Code Here

Examples of com.jcraft.jsch.JSch.addIdentity()

        if (isNotEmpty(sftpConfig.getPrivateKeyFile())) {
            LOG.debug("Using private keyfile: {}", sftpConfig.getPrivateKeyFile());
            if (isNotEmpty(sftpConfig.getPrivateKeyFilePassphrase())) {
                jsch.addIdentity(sftpConfig.getPrivateKeyFile(), sftpConfig.getPrivateKeyFilePassphrase());
            } else {
                jsch.addIdentity(sftpConfig.getPrivateKeyFile());
            }
        }

        if (isNotEmpty(sftpConfig.getKnownHostsFile())) {
            LOG.debug("Using knownhosts file: {}", sftpConfig.getKnownHostsFile());
View Full Code Here

Examples of com.jcraft.jsch.JSch.addIdentity()

     * @throws JSchException on error
     */
    protected Session openSession() throws JSchException {
        JSch jsch = new JSch();
        if (null != userInfo.getKeyfile()) {
            jsch.addIdentity(userInfo.getKeyfile());
        }

        if (!userInfo.getTrust() && knownHosts != null) {
            log("Using known hosts: " + knownHosts, Project.MSG_DEBUG);
            jsch.setKnownHosts(knownHosts);
View Full Code Here

Examples of com.jcraft.jsch.JSch.addIdentity()

    }
    String knownHosts = defaultSSHDir + "/known_hosts";
    knownHosts = System.getProperty("ssh.knownhosts", knownHosts);
    jsch.setKnownHosts(knownHosts);
    identityFile = System.getProperty("ssh.identity", identityFile);
    jsch.addIdentity(identityFile, passphrase.getBytes());
    session = jsch.getSession(user, host);
    Properties props = new Properties();
    props.put("compression.s2c", "none");
    props.put("compression.c2s", "none");
    props.put("cipher.s2c", "blowfish-cbc,3des-cbc");
View Full Code Here

Examples of com.jcraft.jsch.JSch.addIdentity()

        if ( privateKey != null && privateKey.exists() )
        {
            fireSessionDebug( "Using private key: " + privateKey );
            try
            {
                sch.addIdentity( privateKey.getAbsolutePath(), authenticationInfo.getPassphrase() );
            }
            catch ( JSchException e )
            {
                throw new AuthenticationException( "Cannot connect. Reason: " + e.getMessage(), e );
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.