Skip to content

Commit

Permalink
Merge pull request #482 from norrisjeremy/20240115
Browse files Browse the repository at this point in the history
0.2.17 changes
  • Loading branch information
mwiede authored Feb 2, 2024
2 parents 6167635 + 5927085 commit 1d9ed45
Show file tree
Hide file tree
Showing 157 changed files with 1,317 additions and 949 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
java-version: ${{ matrix.java }}
check-latest: true
- name: Test with Maven
run: ./mvnw -B -V -e -P coverage verify -Denforcer.skip=true -Dmaven.resources.skip=true -Dmaven.main.skip=true -Dbnd.skip=true -Dassembly.skipAssembly=true -Dmaven.javadoc.skip=true -Dcyclonedx.skip=true -DskipITs=false
run: ./mvnw -B -V -e -P coverage verify -Denforcer.skip=true -Dmaven.resources.skip=true -Dflatten.skip=true -Dmaven.main.skip=true -Dbnd.skip=true -Dassembly.skipAssembly=true -Dmaven.javadoc.skip=true -Dcyclonedx.skip=true -DskipITs=false
- uses: actions/upload-artifact@v4
with:
name: java-${{ matrix.java }}-testresults
Expand Down
24 changes: 15 additions & 9 deletions examples/AES.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
/**
* This program will demonstrate how to use "aes128-cbc".
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
/** This program will demonstrate how to use "aes128-cbc". */
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UIKeyboardInteractive;
import com.jcraft.jsch.UserInfo;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class AES {
public static void main(String[] arg) {
Expand Down Expand Up @@ -142,5 +150,3 @@ public String[] promptKeyboardInteractive(String destination, String name, Strin
}
}
}


8 changes: 5 additions & 3 deletions examples/ChangePassphrase.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
* a new private key. A passphrase will be prompted if the given private-key has been encrypted.
* After successfully loading the content of the private-key, the new passphrase will be prompted
* and the given private-key will be re-encrypted with that new passphrase.
*
*/
import com.jcraft.jsch.*;
import javax.swing.*;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.KeyPair;
import javax.swing.JOptionPane;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class ChangePassphrase {
public static void main(String[] arg) {
Expand Down
20 changes: 14 additions & 6 deletions examples/Compression.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
* This program will demonstrate the packet compression. You will be asked username, hostname and
* passwd. If everything works fine, you will get the shell prompt. In this program, all data from
* sshd server to jsch will be compressed.
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UIKeyboardInteractive;
import com.jcraft.jsch.UserInfo;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class Compression {
public static void main(String[] arg) {
Expand Down Expand Up @@ -141,5 +151,3 @@ public String[] promptKeyboardInteractive(String destination, String name, Strin
}
}
}


24 changes: 19 additions & 5 deletions examples/Daemon.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
/**
* This program will demonstrate how to provide a network service like inetd by using remote
* port-forwarding functionality.
*
*/
import com.jcraft.jsch.*;
import java.io.*;
import java.awt.*;
import javax.swing.*;
import com.jcraft.jsch.ChannelForwardedTCPIP;
import com.jcraft.jsch.ForwardedTCPIPDaemon;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UIKeyboardInteractive;
import com.jcraft.jsch.UserInfo;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class Daemon {
public static void main(String[] arg) {
Expand Down
21 changes: 16 additions & 5 deletions examples/Exec.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@
* This program will demonstrate remote exec. You will be asked username, hostname, displayname,
* passwd and command. If everything works fine, given command will be invoked on the remote side
* and outputs will be printed out.
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
import java.io.*;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UIKeyboardInteractive;
import com.jcraft.jsch.UserInfo;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.io.InputStream;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class Exec {
public static void main(String[] arg) {
Expand Down
13 changes: 10 additions & 3 deletions examples/JSchWithAgentProxy.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import com.jcraft.jsch.*;
import java.io.*;
import javax.swing.*;
import com.jcraft.jsch.AgentIdentityRepository;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelShell;
import com.jcraft.jsch.IdentityRepository;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.SSHAgentConnector;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UIKeyboardInteractive;
import com.jcraft.jsch.UserInfo;
import javax.swing.JOptionPane;

public class JSchWithAgentProxy {
public static void main(String[] arg) {
Expand Down
18 changes: 14 additions & 4 deletions examples/JumpHosts.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
* to host2 and host3. java JumpHosts usr1@host1 usr2@host2 usr3@host3. You will be asked passwords
* for those destinations. If everything works fine, you will get file lists of your home-directory
* at host3.
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UIKeyboardInteractive;
import com.jcraft.jsch.UserInfo;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class JumpHosts {
public static void main(String[] arg) {
Expand Down
8 changes: 5 additions & 3 deletions examples/KeyGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
* This progam will demonstrate the keypair generation. You will be asked a passphrase for
* output_keyfile. If everything works fine, you will get the keypair, output_keyfile and
* output_keyfile+".pub". The private key and public key are in the OpenSSH format.
*
*/
import com.jcraft.jsch.*;
import javax.swing.*;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.KeyPair;
import javax.swing.JOptionPane;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class KeyGen {
public static void main(String[] arg) {
Expand Down
23 changes: 17 additions & 6 deletions examples/KnownHosts.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,24 @@
* hostname, a path for 'known_hosts' and passwd. If everything works fine, you will get the shell
* prompt. In current implementation, jsch only reads 'known_hosts' for checking and does not modify
* it.
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.HostKey;
import com.jcraft.jsch.HostKeyRepository;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UIKeyboardInteractive;
import com.jcraft.jsch.UserInfo;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class KnownHosts {
public static void main(String[] arg) {
Expand Down Expand Up @@ -159,5 +172,3 @@ public String[] promptKeyboardInteractive(String destination, String name, Strin
}
}
}


25 changes: 16 additions & 9 deletions examples/Logger.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
/**
* This program will demonstrate how to enable logging mechanism and get logging messages.
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
/** This program will demonstrate how to enable logging mechanism and get logging messages. */
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UIKeyboardInteractive;
import com.jcraft.jsch.UserInfo;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class Logger {
public static void main(String[] arg) {
Expand Down Expand Up @@ -44,6 +52,7 @@ public static void main(String[] arg) {

public static class MyLogger implements com.jcraft.jsch.Logger {
static java.util.Map<Integer, String> name = new java.util.HashMap<>();

static {
name.put(DEBUG, "DEBUG: ");
name.put(INFO, "INFO: ");
Expand Down Expand Up @@ -158,5 +167,3 @@ public String[] promptKeyboardInteractive(String destination, String name, Strin
}
}
}


13 changes: 8 additions & 5 deletions examples/OpenSSHConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
* This program demonsrates how to use OpenSSHConfig class. You will be asked username, hostname and
* passwd. If everything works fine, you will get the shell prompt. Output may be ugly because of
* lacks of terminal-emulation, but you can issue commands.
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ConfigRepository;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UIKeyboardInteractive;
import com.jcraft.jsch.UserInfo;
import javax.swing.JOptionPane;

public class OpenSSHConfig {
public static void main(String[] arg) {
Expand Down Expand Up @@ -96,7 +99,7 @@ public boolean promptYesNo(String message) {
}
}

public static abstract class MyUserInfo implements UserInfo, UIKeyboardInteractive {
public abstract static class MyUserInfo implements UserInfo, UIKeyboardInteractive {
@Override
public String getPassword() {
return null;
Expand Down
17 changes: 13 additions & 4 deletions examples/PortForwardingL.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@
* on the local host will be forwarded to the given remote host and port on the remote side. You
* will be asked username, hostname, port:host:hostport and passwd. If everything works fine, you
* will get the shell prompt. Try the port on localhost.
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UIKeyboardInteractive;
import com.jcraft.jsch.UserInfo;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class PortForwardingL {
public static void main(String[] arg) {
Expand Down
17 changes: 13 additions & 4 deletions examples/PortForwardingR.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@
* on the remote host will be forwarded to the given host and port on the local side. You will be
* asked username, hostname, port:host:hostport and passwd. If everything works fine, you will get
* the shell prompt. Try the port on remote host.
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UIKeyboardInteractive;
import com.jcraft.jsch.UserInfo;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class PortForwardingR {
public static void main(String[] arg) {
Expand Down
25 changes: 20 additions & 5 deletions examples/ScpFrom.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
/**
* This program will demonstrate the file transfer from remote to local. If everything works fine, a
* file 'file1' on 'remotehost' will copied to local 'file1'.
*
*/
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;
import java.io.*;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UIKeyboardInteractive;
import com.jcraft.jsch.UserInfo;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class ScpFrom {
public static void main(String[] arg) {
Expand Down
Loading

0 comments on commit 1d9ed45

Please sign in to comment.