harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r446586 - /incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/
Date Fri, 15 Sep 2006 12:05:34 GMT
Author: smishura
Date: Fri Sep 15 05:05:33 2006
New Revision: 446586

URL: http://svn.apache.org/viewvc?view=rev&rev=446586
Log:
Apply patch for HARMONY-1473 (Keytool - removed unnecessary exceptions declarations)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CRLManager.java
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CertChainVerifier.java
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CertReader.java
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/EntryManager.java
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyCertGenerator.java
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreCertPrinter.java
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreConverter.java
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreLoaderSaver.java
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolParameters.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java?view=diff&rev=446586&r1=446585&r2=446586
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java
Fri Sep 15 05:05:33 2006
@@ -172,6 +172,8 @@
      *         is null or empty, an unknown option is found or an expected
      *         option value is not given or not of an expected type.
      * @throws IOException
+     * @throws NumberFormatException
+     * @throws KeytoolException
      */
 
     static KeytoolParameters parseArgs(String[] args)

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CRLManager.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CRLManager.java?view=diff&rev=446586&r1=446585&r2=446586
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CRLManager.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CRLManager.java
Fri Sep 15 05:05:33 2006
@@ -39,7 +39,6 @@
      * 
      * @return true if found at least one revoked certifiacte
      * @param param
-     * @throws KeytoolException
      * @throws IOException
      * @throws CRLException
      * @throws NoSuchProviderException
@@ -50,7 +49,7 @@
     static boolean checkRevoked(KeytoolParameters param)
             throws FileNotFoundException, CertificateException,
             NoSuchProviderException, CRLException, IOException,
-            KeytoolException, NoSuchAlgorithmException {
+            NoSuchAlgorithmException {
 
         String provider = param.getProvider();
         String certProvider = (param.getCertProvider() != null) ? param

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CertChainVerifier.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CertChainVerifier.java?view=diff&rev=446586&r1=446585&r2=446586
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CertChainVerifier.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CertChainVerifier.java
Fri Sep 15 05:05:33 2006
@@ -698,14 +698,13 @@
      * @throws NoSuchAlgorithmException
      * @throws CertificateException
      * @throws IOException
-     * @throws KeytoolException
      * @throws KeyStoreException
      * @throws NoSuchProviderException
      */
     static boolean isTrusted(KeytoolParameters param, X509Certificate cert)
             throws FileNotFoundException, NoSuchAlgorithmException,
-            CertificateException, IOException, KeytoolException,
-            KeyStoreException, NoSuchProviderException {
+            CertificateException, IOException, KeyStoreException,
+            NoSuchProviderException {
         // check the main keyStore
         KeyStore keyStore = param.getKeyStore();
         String alias = keyStore.getCertificateAlias(cert);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CertReader.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CertReader.java?view=diff&rev=446586&r1=446585&r2=446586
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CertReader.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/CertReader.java
Fri Sep 15 05:05:33 2006
@@ -50,12 +50,11 @@
      * @return
      * @throws NoSuchProviderException 
      * @throws CertificateException 
-     * @throws KeytoolException 
      * @throws IOException 
      */
     static Collection readCerts(String fileName, boolean readOnlyFirst,
             String providerName) throws CertificateException,
-            NoSuchProviderException, IOException, KeytoolException {
+            NoSuchProviderException, IOException {
 
         InputStream input = getInputStream(fileName);
         CertificateFactory factory = getCertificateFactory(providerName);
@@ -73,7 +72,7 @@
         // if the file is empty or nothing was entered
         // FIXME: remove available. Try to read and catch exception?
         if (input.available() <= 0) {
-            throw new KeytoolException("Empty input");
+            throw new IOException("Empty input");
         }
 
         Collection certCollection;
@@ -105,14 +104,13 @@
      * @return
      * @throws NoSuchProviderException
      * @throws CertificateException
-     * @throws KeytoolException
      * @throws IOException
      * @throws CRLException
      * 
      */
     static Collection readCRLs(String fileName, String providerName)
             throws CertificateException, NoSuchProviderException, IOException,
-            KeytoolException, CRLException {
+            CRLException {
 
         InputStream input = getInputStream(fileName);
         CertificateFactory factory = getCertificateFactory(providerName);
@@ -130,7 +128,7 @@
         // if the file is empty or nothing was entered
         // FIXME: remove available. Try to read and catch exception?
         if (input.available() <= 0) {
-            throw new KeytoolException("Empty input");
+            throw new IOException("Empty input");
         }
 
         try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/EntryManager.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/EntryManager.java?view=diff&rev=446586&r1=446585&r2=446586
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/EntryManager.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/EntryManager.java
Fri Sep 15 05:05:33 2006
@@ -76,7 +76,6 @@
      * 
      * @param param
      * @throws KeyStoreException
-     * @throws KeytoolException 
      * @throws IOException 
      * @throws NoSuchProviderException 
      * @throws FileNotFoundException 
@@ -85,8 +84,7 @@
      */
     static void delete(KeytoolParameters param) throws KeyStoreException,
             NoSuchAlgorithmException, CertificateException,
-            FileNotFoundException, NoSuchProviderException, IOException,
-            KeytoolException {
+            FileNotFoundException, NoSuchProviderException, IOException {
         param.getKeyStore().deleteEntry(param.getAlias());
         param.setNeedSaveKS(true);
     }
@@ -98,7 +96,6 @@
      * @throws KeyStoreException
      * @throws NoSuchAlgorithmException
      * @throws UnrecoverableKeyException
-     * @throws KeytoolException 
      * @throws IOException 
      * @throws NoSuchProviderException 
      * @throws FileNotFoundException 
@@ -107,7 +104,7 @@
     static void keyPasswd(KeytoolParameters param) throws KeyStoreException,
             NoSuchAlgorithmException, UnrecoverableKeyException,
             CertificateException, FileNotFoundException,
-            NoSuchProviderException, IOException, KeytoolException {
+            NoSuchProviderException, IOException {
         KeyStore keyStore = param.getKeyStore();
         String alias = param.getAlias();
         Key key;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyCertGenerator.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyCertGenerator.java?view=diff&rev=446586&r1=446585&r2=446586
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyCertGenerator.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyCertGenerator.java
Fri Sep 15 05:05:33 2006
@@ -145,6 +145,8 @@
                 sigAlgName = "SHA1withDSA";
             } else if (keyAlg.equalsIgnoreCase("RSA")) {
                 sigAlgName = "MD5withRSA";
+            }else {
+                sigAlgName = keyAlg;
             }
         } else {
             String issuerKeyAlg = issuerPrivateKey.getAlgorithm();
@@ -153,10 +155,7 @@
             } else if (issuerKeyAlg.equalsIgnoreCase("RSA")) {
                 sigAlgName = "MD5withRSA";
             } else {
-                // FIXME: can a kind of search be done?
-                throw new KeytoolException(
-                        "Cannot find signature algorithm for issuer's key algorithm "
-                                + issuerKeyAlg);
+                sigAlgName = issuerKeyAlg;
             }
         }
         // set the certificate validity period
@@ -511,7 +510,7 @@
     private static void generateSecretKey(KeytoolParameters param)
             throws NoSuchAlgorithmException, NoSuchProviderException,
             KeyStoreException, CertificateException, FileNotFoundException,
-            IOException, KeytoolException {
+            IOException {
 
         String keyAlg = param.getKeyAlg();
         int keySize = param.getKeySize();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreCertPrinter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreCertPrinter.java?view=diff&rev=446586&r1=446585&r2=446586
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreCertPrinter.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreCertPrinter.java
Fri Sep 15 05:05:33 2006
@@ -53,7 +53,6 @@
      * @throws NoSuchAlgorithmException
      * @throws NoSuchProviderException
      * @throws UnrecoverableKeyException
-     * @throws KeytoolException 
      * @throws IOException 
      * @throws FileNotFoundException 
      * @throws CertificateException 
@@ -61,7 +60,7 @@
     static void list(KeytoolParameters param) throws KeyStoreException,
             NoSuchAlgorithmException, NoSuchProviderException,
             UnrecoverableKeyException, CertificateException,
-            FileNotFoundException, IOException, KeytoolException {
+            FileNotFoundException, IOException {
         Enumeration aliases;
         KeyStore keyStore = param.getKeyStore();
         String alias = param.getAlias();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreConverter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreConverter.java?view=diff&rev=446586&r1=446585&r2=446586
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreConverter.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreConverter.java
Fri Sep 15 05:05:33 2006
@@ -39,12 +39,11 @@
      * @throws CertificateException
      * @throws NoSuchProviderException
      * @throws IOException
-     * @throws KeytoolException
      */
     static void convertKeyStore(KeytoolParameters param)
             throws KeyStoreException, FileNotFoundException,
             NoSuchAlgorithmException, CertificateException,
-            NoSuchProviderException, IOException, KeytoolException {
+            NoSuchProviderException, IOException {
 
         // get the main keystore
         KeyStore mainKS = param.getKeyStore();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreLoaderSaver.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreLoaderSaver.java?view=diff&rev=446586&r1=446585&r2=446586
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreLoaderSaver.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreLoaderSaver.java
Fri Sep 15 05:05:33 2006
@@ -46,13 +46,12 @@
      * @throws FileNotFoundException
      * @throws IOException
      * @throws KeyStoreException
-     * @throws KeytoolException
      * @throws NoSuchProviderException
      */
     static void loadStore(KeytoolParameters param)
             throws NoSuchAlgorithmException, CertificateException,
             FileNotFoundException, IOException, KeyStoreException,
-            NoSuchProviderException, KeytoolException {
+            NoSuchProviderException {
 
         // If the path to the store is not specified, try to open
         // the store using the default path.
@@ -93,19 +92,18 @@
      * @throws CertificateException
      * @throws IOException
      * @throws NoSuchProviderException
-     * @throws KeytoolException
      */
     static KeyStore loadStore(String path, String storeType, char[] storePass,
             String providerName) throws FileNotFoundException,
             KeyStoreException, NoSuchAlgorithmException, CertificateException,
-            IOException, NoSuchProviderException, KeytoolException {
+            IOException, NoSuchProviderException {
 
         BufferedInputStream bis;
         // if the path is given, make a FileInputStream on it
         if (path != null) {
             File ksFile = new File(path);
             if (ksFile.length() == 0) {
-                throw new KeytoolException("Keystore file exists but is empty");
+                throw new IOException("Keystore file exists but is empty");
             }
             bis = new BufferedInputStream(new FileInputStream(ksFile));
         } else { // if the path is not given, a new keystore will be created
@@ -156,12 +154,11 @@
      * @throws NoSuchAlgorithmException
      * @throws CertificateException
      * @throws IOException
-     * @throws KeytoolException 
      * @throws NoSuchProviderException 
      */
     static void saveStore(KeytoolParameters param) throws KeyStoreException,
             NoSuchAlgorithmException, CertificateException, IOException,
-            NoSuchProviderException, KeytoolException {
+            NoSuchProviderException {
         saveStore(param.getKeyStore(), param.getStorePath(), param
                 .getStorePass(), param.isVerbose());
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolParameters.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolParameters.java?view=diff&rev=446586&r1=446585&r2=446586
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolParameters.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolParameters.java
Fri Sep 15 05:05:33 2006
@@ -229,7 +229,6 @@
     // getters and setters down here.
     /**
      * @return Returns the keystore to work with.
-     * @throws KeytoolException 
      * @throws IOException 
      * @throws NoSuchProviderException 
      * @throws KeyStoreException 
@@ -239,7 +238,7 @@
      */
     KeyStore getKeyStore() throws NoSuchAlgorithmException,
             CertificateException, FileNotFoundException, KeyStoreException,
-            NoSuchProviderException, IOException, KeytoolException {
+            NoSuchProviderException, IOException {
         if (keyStore == null){
             KeyStoreLoaderSaver.loadStore(this);
         }
@@ -879,7 +878,6 @@
     /**
      * @return cacerts keystore containing the certificates from root
      *         certificate authorities (usually self-signed)
-     * @throws KeytoolException 
      * @throws IOException 
      * @throws NoSuchProviderException 
      * @throws CertificateException 
@@ -889,7 +887,7 @@
      */
     KeyStore getCacerts() throws FileNotFoundException, KeyStoreException,
             NoSuchAlgorithmException, CertificateException,
-            NoSuchProviderException, IOException, KeytoolException {
+            NoSuchProviderException, IOException {
         if (cacerts == null) {
             String keyStoreProv = (ksProvider != null) ? ksProvider : provider;
             cacerts = KeyStoreLoaderSaver.loadStore(getCacertsPath(),



Mime
View raw message