All pastes #31722 Raw Edit

Stuff

public java v1 · immutable
#31722 ·published 2005-11-29 20:54 UTC
rendered paste body
/** * This is the test class of RSAConvert. * * @author Wolfman2000 * @version 0.2 */import java.math.BigInteger;import javax.swing.JOptionPane;public class RSAConvertTest {        /**     * This main method is merely a tester method.     * @param args the command line variable that's not used.     */        public static void main (String[] args) {                try {                        RSAConvert trans = new RSAConvert();                        String input1 = JOptionPane.showInputDialog("Insert the " +               "encryption/decryption key value:");            String input2 = JOptionPane.showInputDialog("Insert the " +              "modulus value:");            String input3 = JOptionPane.showInputDialog("Enter the " +              "message in ASCII decimal code.  Put a space between " +              "each character.");                          BigInteger num1 = new BigInteger(input1);            BigInteger num2 = new BigInteger(input2);                        String translated = trans.convert(num1, num2, input3);                        System.out.println("The converted message is:\n" +              translated);                        System.exit(0);                    }                catch (NumberFormatException error) {                        System.err.println("A number must be entered.");            System.exit(686);                    }            }    }