Package org.apache.sshd.agent.local

Examples of org.apache.sshd.agent.local.LocalAgentFactory


    return new SshTunnelSocket(sshConnection.sshClientSession);
  }

  @Override
  public SshConnection buildAgentConnection(KeyPair agentKeyPair) throws IOException, SshException {
    LocalAgentFactory agentFactory = new LocalAgentFactory();
    SshAgent agent = agentFactory.getAgent();
    try {
      agent.addIdentity(agentKeyPair, "default");
    } catch (IOException e) {
      throw new IllegalArgumentException("Error adding agent identity", e);
    }
View Full Code Here


        int port1 = getFreePort();
        int port2 = getFreePort();

        TestEchoShellFactory shellFactory = new TestEchoShellFactory();
        ProxyAgentFactory agentFactory = new ProxyAgentFactory();
        LocalAgentFactory localAgentFactory = new LocalAgentFactory();

        KeyPair pair = createTestKeyPairProvider("dsaprivkey.pem").loadKey(KeyPairProvider.SSH_DSS);
        localAgentFactory.getAgent().addIdentity(pair, "smx");

        SshServer sshd1 = SshServer.setUpDefaultServer();
        sshd1.setPort(port1);
        sshd1.setKeyPairProvider(Utils.createTestHostKeyProvider());
        sshd1.setShellFactory(shellFactory);
View Full Code Here

    private static void setupAgent(String user, SshClient client) {
        SshAgent agent;
        URL builtInPrivateKey = Main.class.getClassLoader().getResource("karaf.key");
        agent = startAgent(user, builtInPrivateKey);
        client.setAgentFactory(new LocalAgentFactory(agent));
        client.getProperties().put(SshAgent.SSH_AUTHSOCKET_ENV_NAME, "local");
    }
View Full Code Here

    private static void setupAgent(String user, SshClient client, String keyFile) {
        SshAgent agent;
        URL builtInPrivateKey = Main.class.getClassLoader().getResource("karaf.key");
        agent = startAgent(user, builtInPrivateKey, keyFile);
        client.setAgentFactory(new LocalAgentFactory(agent));
        client.getProperties().put(SshAgent.SSH_AUTHSOCKET_ENV_NAME, "local");
    }
View Full Code Here

    private static void setupAgent(String user, SshClient client) {
        SshAgent agent;
        URL builtInPrivateKey = Main.class.getClassLoader().getResource("karaf.key");
        agent = startAgent(user, builtInPrivateKey);
        client.setAgentFactory(new LocalAgentFactory(agent));
        client.getProperties().put(SshAgent.SSH_AUTHSOCKET_ENV_NAME, "local");
    }
View Full Code Here

        int port1 = getFreePort();
        int port2 = getFreePort();

        TestEchoShellFactory shellFactory = new TestEchoShellFactory();
        ProxyAgentFactory agentFactory = new ProxyAgentFactory();
        LocalAgentFactory localAgentFactory = new LocalAgentFactory();

        KeyPair pair = new FileKeyPairProvider(new String[] { "src/test/resources/dsaprivkey.pem" }).loadKey(KeyPairProvider.SSH_DSS);
        localAgentFactory.getAgent().addIdentity(pair, "smx");

        SshServer sshd1 = SshServer.setUpDefaultServer();
        sshd1.setPort(port1);
        sshd1.setKeyPairProvider(new FileKeyPairProvider(new String[]{"src/test/resources/hostkey.pem"}));
        sshd1.setShellFactory(shellFactory);
View Full Code Here

        Terminal terminal = null;
        SshAgent agent = null;
        try {
            agent = startAgent(user);
            client = SshClient.setUpDefaultClient();
            client.setAgentFactory(new LocalAgentFactory(agent));
            client.getProperties().put(SshAgent.SSH_AUTHSOCKET_ENV_NAME, "local");
            client.start();
            int retries = 0;
            ClientSession session = null;
            do {
View Full Code Here

        Terminal terminal = null;
        SshAgent agent = null;
        try {
            agent = startAgent(user);
            client = SshClient.setUpDefaultClient();
            client.setAgentFactory(new LocalAgentFactory(agent));
            client.getProperties().put(SshAgent.SSH_AUTHSOCKET_ENV_NAME, "local");
            client.start();
            int retries = 0;
            ClientSession session = null;
            do {
View Full Code Here

        SshAgent agent = null;
        int exitStatus = 0;
        try {
            agent = startAgent(user, keyFile);
            client = SshClient.setUpDefaultClient();
            client.setAgentFactory(new LocalAgentFactory(agent));
            client.getProperties().put(SshAgent.SSH_AUTHSOCKET_ENV_NAME, "local");
            client.start();
            int retries = 0;
            ClientSession session = null;
            do {
View Full Code Here

        Terminal terminal = null;
        SshAgent agent = null;
        try {
            agent = startAgent(user);
            client = SshClient.setUpDefaultClient();
            client.setAgentFactory(new LocalAgentFactory(agent));
            client.getProperties().put(SshAgent.SSH_AUTHSOCKET_ENV_NAME, "local");
            client.start();
            int retries = 0;
            ClientSession session = null;
            do {
View Full Code Here

TOP

Related Classes of org.apache.sshd.agent.local.LocalAgentFactory

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.