diff options
Diffstat (limited to 'pki/base/java-tools/src/com/netscape/cmstools/TestCRLSigning.java')
-rw-r--r-- | pki/base/java-tools/src/com/netscape/cmstools/TestCRLSigning.java | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/pki/base/java-tools/src/com/netscape/cmstools/TestCRLSigning.java b/pki/base/java-tools/src/com/netscape/cmstools/TestCRLSigning.java index d43b35337..10956748d 100644 --- a/pki/base/java-tools/src/com/netscape/cmstools/TestCRLSigning.java +++ b/pki/base/java-tools/src/com/netscape/cmstools/TestCRLSigning.java @@ -34,19 +34,17 @@ import org.mozilla.jss.util.Password; /** * Tool used to test out signing a CRL - * + * * <p> + * * @version $Revision$ Date: $ */ -public class TestCRLSigning -{ - public static void printUsage() - { - System.out.println("Command <dbdir> <numreovked> <keysize> <tokenname> <tokenpwd>"); +public class TestCRLSigning { + public static void printUsage() { + System.out.println("Command <dbdir> <numreovked> <keysize> <tokenname> <tokenpwd>"); } - public static void main(String args[]) throws Exception - { + public static void main(String args[]) throws Exception { String dir = args[0]; String num = args[1]; String keysize = args[2]; @@ -56,18 +54,18 @@ public class TestCRLSigning // initialize JSS CryptoManager cm = null; CryptoManager.InitializationValues vals = - new CryptoManager.InitializationValues(dir, "", "", "secmod.db"); + new CryptoManager.InitializationValues(dir, "", "", "secmod.db"); CryptoManager.initialize(vals); cm = CryptoManager.getInstance(); // Login to token CryptoToken token = null; if (tokenname.equals("internal")) { - token = cm.getInternalKeyStorageToken(); + token = cm.getInternalKeyStorageToken(); } else { - token = cm.getTokenByName(tokenname); + token = cm.getTokenByName(tokenname); } - Password pass = new Password(tokenpwd.toCharArray()); + Password pass = new Password(tokenpwd.toCharArray()); token.login(pass); // generate key pair @@ -81,13 +79,13 @@ public class TestCRLSigning Hashtable badCerts = new Hashtable(); int n = Integer.parseInt(num); for (int i = 0; i < n; i++) { - badCerts.put(Integer.toString(i), - new RevokedCertImpl(new BigInteger(Integer.toString(i)), curDate)); + badCerts.put(Integer.toString(i), + new RevokedCertImpl(new BigInteger(Integer.toString(i)), curDate)); } long endPutting = System.currentTimeMillis(); long startConstructing = System.currentTimeMillis(); - X509CRLImpl crl = new X509CRLImpl( + X509CRLImpl crl = new X509CRLImpl( new X500Name("CN=Signer"), null, curDate, @@ -96,7 +94,6 @@ public class TestCRLSigning null); long endConstructing = System.currentTimeMillis(); - System.out.println("Start signing"); long startSigning = System.currentTimeMillis(); crl.sign(pair.getPrivate(), "SHA1withRSA"); |