62 // ones (MANIFEST, inf, a), and 2) When opened as a JarInputStream, |
62 // ones (MANIFEST, inf, a), and 2) When opened as a JarInputStream, |
63 // when the order is correct (MANIFEST at beginning, followed by RSA/SF, |
63 // when the order is correct (MANIFEST at beginning, followed by RSA/SF, |
64 // directory ignored), we can get 2 signed ones (inf, a). |
64 // directory ignored), we can get 2 signed ones (inf, a). |
65 |
65 |
66 // Prepares raw files |
66 // Prepares raw files |
67 Files.write(Paths.get("a"), "a".getBytes()); |
67 Files.write(Paths.get("a"), List.of("a")); |
68 Files.createDirectory(Paths.get("META-INF/")); |
68 Files.createDirectory(Paths.get("META-INF/")); |
69 Files.write(Paths.get("META-INF/inf"), "inf".getBytes()); |
69 Files.write(Paths.get("META-INF/inf"), List.of("inf")); |
70 |
70 |
71 // Pack, sign, and extract to get all files |
71 // Pack, sign, and extract to get all files |
72 sun.tools.jar.Main m = |
72 sun.tools.jar.Main m = |
73 new sun.tools.jar.Main(System.out, System.err, "jar"); |
73 new sun.tools.jar.Main(System.out, System.err, "jar"); |
74 if (!m.run("cvf a.jar a META-INF/inf".split(" "))) { |
74 if (!m.run("cvf a.jar a META-INF/inf".split(" "))) { |