< prev index next >

src/share/classes/java/util/jar/JarFile.java

Print this page
rev 1455 : 6870812: enhance security tools to use ECC algorithms
Reviewed-by: vinnie, mullan


 283     }
 284 
 285     /*
 286      * Ensures that the JarVerifier has been created if one is
 287      * necessary (i.e., the jar appears to be signed.) This is done as
 288      * a quick check to avoid processing of the manifest for unsigned
 289      * jars.
 290      */
 291     private void maybeInstantiateVerifier() throws IOException {
 292         if (jv != null) {
 293             return;
 294         }
 295 
 296         if (verify) {
 297             String[] names = getMetaInfEntryNames();
 298             if (names != null) {
 299                 for (int i = 0; i < names.length; i++) {
 300                     String name = names[i].toUpperCase(Locale.ENGLISH);
 301                     if (name.endsWith(".DSA") ||
 302                         name.endsWith(".RSA") ||

 303                         name.endsWith(".SF")) {
 304                         // Assume since we found a signature-related file
 305                         // that the jar is signed and that we therefore
 306                         // need a JarVerifier and Manifest
 307                         getManifest();
 308                         return;
 309                     }
 310                 }
 311             }
 312             // No signature-related files; don't instantiate a
 313             // verifier
 314             verify = false;
 315         }
 316     }
 317 
 318 
 319     /*
 320      * Initializes the verifier object by reading all the manifest
 321      * entries and passing them to the verifier.
 322      */




 283     }
 284 
 285     /*
 286      * Ensures that the JarVerifier has been created if one is
 287      * necessary (i.e., the jar appears to be signed.) This is done as
 288      * a quick check to avoid processing of the manifest for unsigned
 289      * jars.
 290      */
 291     private void maybeInstantiateVerifier() throws IOException {
 292         if (jv != null) {
 293             return;
 294         }
 295 
 296         if (verify) {
 297             String[] names = getMetaInfEntryNames();
 298             if (names != null) {
 299                 for (int i = 0; i < names.length; i++) {
 300                     String name = names[i].toUpperCase(Locale.ENGLISH);
 301                     if (name.endsWith(".DSA") ||
 302                         name.endsWith(".RSA") ||
 303                         name.endsWith(".EC") ||
 304                         name.endsWith(".SF")) {
 305                         // Assume since we found a signature-related file
 306                         // that the jar is signed and that we therefore
 307                         // need a JarVerifier and Manifest
 308                         getManifest();
 309                         return;
 310                     }
 311                 }
 312             }
 313             // No signature-related files; don't instantiate a
 314             // verifier
 315             verify = false;
 316         }
 317     }
 318 
 319 
 320     /*
 321      * Initializes the verifier object by reading all the manifest
 322      * entries and passing them to the verifier.
 323      */


< prev index next >