Examples of addIdentity()


Examples of com.cubusmail.common.model.UserAccount.addIdentity()

          account.getPreferences().setLanguage( lang );
        }
      }
      else {
        if ( account.getIdentities() == null || account.getIdentities().size() == 0 ) {
          account.addIdentity( createDefaultIdentity( mailbox ) );
        }
        account.setLastLogin( new Date() );
        this.userAccountDao.saveUserAccount( account );
      }
     
View Full Code Here

Examples of com.cubusmail.gwtui.domain.UserAccount.addIdentity()

          account.getPreferences().setLanguage( lang );
        }
      }
      else {
        if ( account.getIdentities() == null || account.getIdentities().size() == 0 ) {
          account.addIdentity( createDefaultIdentity( mailbox ) );
        }
        account.setLastLogin( new Date() );
      }
      getUserAccountDao().saveUserAccount( account );
      mailbox.setUserAccount( account );
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.getPrivateKeyPassphrase())) {
                jsch.addIdentity(sftpConfig.getPrivateKeyFile(), sftpConfig.getPrivateKeyPassphrase());
            } 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.getPrivateKeyPassphrase())) {
                jsch.addIdentity(sftpConfig.getPrivateKeyFile(), sftpConfig.getPrivateKeyPassphrase());
            } else {
                jsch.addIdentity(sftpConfig.getPrivateKeyFile());
            }
        }

        if (sftpConfig.getPrivateKey() != null) {
            LOG.debug("Using private key information from byte array");
View Full Code Here

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

                    passphrase = sftpConfig.getPrivateKeyPassphrase().getBytes("UTF-8");
                } catch (UnsupportedEncodingException e) {
                    throw new JSchException("Cannot transform passphrase to byte[]", e);
                }
            }
            jsch.addIdentity("ID", sftpConfig.getPrivateKey(), null, passphrase);
        }

        if (sftpConfig.getPrivateKeyUri() != null) {
            LOG.debug("Using private key uri : {}", sftpConfig.getPrivateKeyUri());
            byte[] passphrase = null;
View Full Code Here

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

            }
            try {
                InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(endpoint.getCamelContext().getClassResolver(), sftpConfig.getPrivateKeyUri());
                ByteArrayOutputStream bos = new ByteArrayOutputStream();
                IOHelper.copyAndCloseInput(is, bos);
                jsch.addIdentity("ID", bos.toByteArray(), null, passphrase);
            } catch (IOException e) {
                throw new JSchException("Cannot read resource: " + sftpConfig.getPrivateKeyUri(), e);
            }
        }
View Full Code Here

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

        if (sftpConfig.getKeyPair() != null) {
            LOG.debug("Using private key information from key pair");
            KeyPair keyPair = sftpConfig.getKeyPair();
            if (keyPair.getPrivate() != null && keyPair.getPublic() != null) {
                if (keyPair.getPrivate() instanceof RSAPrivateKey && keyPair.getPublic() instanceof RSAPublicKey) {
                    jsch.addIdentity(new RSAKeyPairIdentity("ID", keyPair), null);
                } else if (keyPair.getPrivate() instanceof DSAPrivateKey && keyPair.getPublic() instanceof DSAPublicKey) {
                    jsch.addIdentity(new DSAKeyPairIdentity("ID", keyPair), null);
                } else {
                    LOG.warn("Only RSA and DSA key pairs are supported");
                }
View Full Code Here

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

            KeyPair keyPair = sftpConfig.getKeyPair();
            if (keyPair.getPrivate() != null && keyPair.getPublic() != null) {
                if (keyPair.getPrivate() instanceof RSAPrivateKey && keyPair.getPublic() instanceof RSAPublicKey) {
                    jsch.addIdentity(new RSAKeyPairIdentity("ID", keyPair), null);
                } else if (keyPair.getPrivate() instanceof DSAPrivateKey && keyPair.getPublic() instanceof DSAPublicKey) {
                    jsch.addIdentity(new DSAKeyPairIdentity("ID", keyPair), null);
                } else {
                    LOG.warn("Only RSA and DSA key pairs are supported");
                }
            } else {
                LOG.warn("PrivateKey and PublicKey in the KeyPair must be filled");
View Full Code Here

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

    private static Session openSession() throws JSchException {
        JSch jsch = new JSch();
        Session session = jsch.getSession("integration",
                "websphereportal8.devnet.vaadin.com", 22);
        jsch.addIdentity("~/.ssh/id_dsa");
        session.setConfig("StrictHostKeyChecking", "no");

        session.connect();
        return session;
    }
View Full Code Here

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

        }
        this.profile = profile;
        this.command = buildCommand(commandLineTokens, profile.getEnvironmentVariables());
        try {
            JSch jsch = new JSch();
            jsch.addIdentity(profile.getPrivateKey(), profile.getPassPhrase());
            session = jsch.getSession(profile.getUser(), profile.getHost(), profile.getPort());
            session.setConfig("StrictHostKeyChecking", "no");
            session.setServerAliveInterval((int) TimeUnit.SECONDS.toMillis(10));
            session.setTimeout((int) TimeUnit.SECONDS.toMillis(60));
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.