KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > jcetaglib > test > RunTest


1 /*
2   Name: RunTest.java
3   Licensing: LGPL
4
5   API: Sun (http://java.sun.com) JCE 1.2.2 API (cleanroom implementation by Bouncy Castle)
6   Provider: Bouncy Castle (http://www.bouncycastle.org)
7
8   Disclaimer:
9
10   COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND,
11   EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE
12   IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE
13   RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE
14   PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR)
15   ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY
16   CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED
17   HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
18
19   (C) Copyright 2003 Gert Van Ham
20 */

21
22 package net.sourceforge.jcetaglib.test;
23
24 import junit.framework.Test;
25 import junit.framework.TestSuite;
26
27 /**
28  * All tests
29  * <P>
30  * These tests can be run using JUnit (http://www.junit.org)
31  *
32  * @author Gert Van Ham
33  * @author hamgert@users.sourceforge.net
34  * @author http://jcetaglib.sourceforge.net
35  * @version $Id: RunTest.java,v 1.2 2004/04/14 09:48:28 hamgert Exp $
36  */

37 public class RunTest {
38
39     // temporary folder
40
public final static String JavaDoc TEMPFOLDER = "C:/tmp/";
41
42     // [blockcipher algorithm,strength]
43
public final static String JavaDoc[][] alg = {
44         {"AES", "128"}
45         , {"AES", "192"}
46         , {"AES", "256"}
47         , {"Blowfish", "128"}
48         , {"Blowfish", "192"}
49         , {"Blowfish", "256"}
50         , {"Blowfish", "448"}
51         , {"CAST5", "128"}
52         , {"CAST6", "256"}
53         , {"DES", "64"}
54         , {"DESede", "192"}
55         , {"IDEA", "128"}
56         , {"RC2", "1024"}
57         , {"RC4", "128"}
58         , {"RC5", "128"}
59         , {"RC6", "128"}
60         , {"Rijndael", "128"}
61         , {"Rijndael", "192"}
62         , {"Rijndael", "256"}
63         , {"Skipjack", "128"}
64         , {"Twofish", "128"}
65         , {"Twofish", "192"}
66         , {"Twofish", "256"}
67         , {"Serpent", "128"}
68         , {"Serpent", "192"}
69         , {"Serpent", "256"}
70     };
71
72     public final static String JavaDoc[] modes = {
73         "ECB"
74         , "CBC"
75         , "OFB8"
76         , "CFB8"};
77
78     public final static String JavaDoc[] padding = {
79         "PKCS7Padding"
80         , "ISO10126Padding"
81         , "X9.23Padding"};
82
83     public final static String JavaDoc[] pbealg = {
84         "PBEWithMD5AndDES"
85         , "PBEWithSHAAnd2-KeyTripleDES-CBC"
86         , "PBEWithSHAAnd3-KeyTripleDES-CBC"
87         , "PBEWithSHAAnd128BitRC2-CBC"
88         , "PBEWithSHAAnd40BitRC2-CBC"
89         , "PBEWithSHAAnd128BitRC4"
90         , "PBEWithSHAAnd40BitRC4"
91         , "PBEWithSHAAndTwofish-CBC"
92         , "PBEWithSHAAndIDEA-CBC"};
93
94     public final static String JavaDoc[] digestalg = {
95         "MD2"
96         , "MD4"
97         , "MD5"
98         , "RipeMD128"
99         , "RipeMD160"
100         , "SHA1"
101         , "SHA-256"
102         , "SHA-384"
103         , "SHA-512"
104         , "Tiger"};
105
106     public final static String JavaDoc[][] macalg = {
107         {"IDEA", "IDEA_128.key"}
108         , {"DESede", "DESede_192.key"}
109         , {"DES", "DES_64.key"}
110         , {"RC2", "RC2_1024.key"}
111         , {"RC5", "RC5_128.key"}
112         , {"Skipjack", "Skipjack_128.key"}
113         , {"IDEA/CFB8", "IDEA_128.key"}
114         , {"DESede/CFB8", "DESede_192.key"}
115         , {"DES/CFB8", "DES_64.key"}
116         , {"RC2/CFB8", "RC2_1024.key"}
117         , {"RC5/CFB8", "RC5_128.key"}
118         , {"Skipjack/CFB8", "Skipjack_128.key"}
119         , {"HMac-SHA1", "IDEA_128.key"}
120         , {"HMac-SHA256", "IDEA_128.key"}
121         , {"HMac-SHA384", "IDEA_128.key"}
122         , {"HMac-SHA512", "IDEA_128.key"}
123         , {"HMac-MD2", "IDEA_128.key"}
124         , {"HMac-MD4", "IDEA_128.key"}
125         , {"HMac-MD5", "IDEA_128.key"}
126         , {"HMac-RipeMD128", "IDEA_128.key"}
127         , {"HMac-RipeMD160", "IDEA_128.key"}
128     };
129
130     public final static String JavaDoc[] sig = {
131         "SHA1WithRSAEncryption"
132         , "MD2WithRSAEncryption"
133         , "MD5WithRSAEncryption"
134         , "RIPEMD160WithRSAEncryption"
135         , "MD5WithRSA/ISO9796-2"
136         , "SHA1WithRSA/ISO9796-2"
137         , "RIPEMD160WithRSA/ISO9796-2"
138     };
139
140     public final static StringBuffer JavaDoc[] text = {
141         new StringBuffer JavaDoc("The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms")
142         , new StringBuffer JavaDoc("This software is distributed under a license based on the MIT X Consortium license")
143         , new StringBuffer JavaDoc("found in $JAVA_HOME/jre/lib/security/java.security, where $JAVA_HOME is the location of your JDK/JRE distribution")
144         , new StringBuffer JavaDoc("Mit Project 2002 zum erfolgreichen Projektmanagement Damit Sie in Zukunft Ihre Projekte präzise und komfortabel steuern können")
145         , new StringBuffer JavaDoc("En av de största nyheterna är att det finns en .NET Enterprise Server-lösning för stora företagsomspännade projekt")
146         , new StringBuffer JavaDoc("Lees de productinformatie en ontdek alles over de krachtige tools binnen Visual Studio .NET")
147         , new StringBuffer JavaDoc("Vergeet even die oude tovenaars met puntige hoeden en rondborstige jonkvrouwen in nood... oké, vergeet in ieder geval even die tovenaars, want Lionheart komt met een ambitieuze rollenspelvariant")
148         , new StringBuffer JavaDoc("An implementation of ECIES (stream mode) as described in IEEE P 1363a.")
149         , new StringBuffer JavaDoc("This makes the entire keystore resistant to tampering and inspection, and forces verification")
150         , new StringBuffer JavaDoc("application/pkcs7-signature;; x-java-content-handler=org.bouncycastle.mail.smime.handlers.pkcs7_signature")
151     };
152
153     /**
154      * Returns a test suite to the JUnit test runner.
155      *
156      * @return suite of tests
157      */

158     public static Test suite() {
159         TestSuite suite = new TestSuite("net.sourceforge.jcetaglib");
160         suite.addTestSuite(KeyTest.class);
161         suite.addTestSuite(DigestTest.class);
162         suite.addTestSuite(CryptTest.class);
163         suite.addTestSuite(AsymmetricTest.class);
164         suite.addTestSuite(PBETest.class);
165         suite.addTestSuite(MacTest.class);
166         suite.addTestSuite(SignatureTest.class);
167         suite.addTestSuite(HybridTest.class);
168         suite.addTestSuite(X509CertTest.class);
169         suite.addTestSuite(DHKeyAgreementTest.class);
170         return suite;
171     }
172
173     /**
174      * Main method to run the tests from the command line
175      *
176      * @param args
177      */

178     public static void main(String JavaDoc args[]) {
179         junit.textui.TestRunner.run(suite());
180     }
181 }
182
183
Popular Tags