Package com.sshtools.j2ssh.transport.kex

Examples of com.sshtools.j2ssh.transport.kex.SshKeyExchange


        List list = SshKeyExchangeFactory.getSupportedKeyExchanges();
        Iterator it = list.iterator();
       
        while (it.hasNext()) {
          String keyExchange = (String) it.next();
          SshKeyExchange kex = SshKeyExchangeFactory.newInstance(keyExchange);
          kex.init(this);
          kexs.put(keyExchange, kex);
        }
       
        // call abstract to initialise the local ident string
        setLocalIdent();
View Full Code Here


            if (log.isDebugEnabled()) {
                log.debug("Key exchange algorithm: " + kexAlgorithm);
            }

            // Get an instance of the key exchange algortihm
            SshKeyExchange kex = (SshKeyExchange) kexs.get(kexAlgorithm);

            // Do the key exchange
            performKeyExchange(kex);

            // Record the output
            exchangeHash = kex.getExchangeHash();

            if (sessionIdentifier == null) {
                sessionIdentifier = new byte[exchangeHash.length];
                System.arraycopy(exchangeHash, 0, sessionIdentifier, 0,
                    sessionIdentifier.length);
                thread.setSessionId(sessionIdentifier);
            }

            hostKey = kex.getHostKey();
            signature = kex.getSignature();
            k = kex.getSecret();

            // Send new keys
            sendNewKeys();
            kex.reset();
        } catch (AlgorithmNotAgreedException e) {
            sendDisconnect(SshMsgDisconnect.KEY_EXCHANGE_FAILED,
                "No suitable key exchange algorithm was agreed");
            throw new KeyExchangeException(
                "No suitable key exchange algorithm could be agreed.");
View Full Code Here

            List list = SshKeyExchangeFactory.getSupportedKeyExchanges();
            Iterator it = list.iterator();

            while (it.hasNext()) {
                String keyExchange = (String) it.next();
                SshKeyExchange kex = SshKeyExchangeFactory.newInstance(keyExchange);
                kex.init(this);
                kexs.put(keyExchange, kex);
            }

            // call abstract to initialise the local ident string
            setLocalIdent();
View Full Code Here

            if (log.isDebugEnabled()) {
                log.debug("Key exchange algorithm: " + kexAlgorithm);
            }

            // Get an instance of the key exchange algortihm
            SshKeyExchange kex = (SshKeyExchange) kexs.get(kexAlgorithm);

            // Do the key exchange
            performKeyExchange(kex);

            // Record the output
            exchangeHash = kex.getExchangeHash();

            if (sessionIdentifier == null) {
                sessionIdentifier = new byte[exchangeHash.length];
                System.arraycopy(exchangeHash, 0, sessionIdentifier, 0,
                    sessionIdentifier.length);
                thread.setSessionId(sessionIdentifier);
            }

            hostKey = kex.getHostKey();
            signature = kex.getSignature();
            k = kex.getSecret();

            // Send new keys
            sendNewKeys();
            kex.reset();
        } catch (AlgorithmNotAgreedException e) {
            sendDisconnect(SshMsgDisconnect.KEY_EXCHANGE_FAILED,
                "No suitable key exchange algorithm was agreed");
            throw new KeyExchangeException(
                "No suitable key exchange algorithm could be agreed.");
View Full Code Here

TOP

Related Classes of com.sshtools.j2ssh.transport.kex.SshKeyExchange

Copyright © 2018 www.massapicom. 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.