Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
msridhar committed Jun 1, 2024
1 parent fa160f3 commit 9d60665
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -515,17 +515,16 @@ public void testSignedJars() throws Exception {
/** copy the jar at {@code baseJarPath} to a signed jar at {@code signedJarPath} */
private void copyAndSignJar(String baseJarPath, String signedJarPath)
throws CertificateException,
NoSuchAlgorithmException,
KeyStoreException,
IOException,
NoSuchAlgorithmException,
UnrecoverableEntryException {
String ksPath =
Thread.currentThread().getContextClassLoader().getResource("testKeyStore.jks").getPath();
var ksPwd = "testPassword";
var ksPwdArray = ksPwd.toCharArray();
var keystore = KeyStore.getInstance(new File(ksPath), ksPwdArray);
var protParam = new KeyStore.PasswordProtection(ksPwdArray);
var pkEntry = (KeyStore.PrivateKeyEntry) keystore.getEntry(ksPwd, protParam);
var ksPassword = "testPassword".toCharArray();
var keystore = KeyStore.getInstance(new File(ksPath), ksPassword);
var protParam = new KeyStore.PasswordProtection(ksPassword);
var pkEntry = (KeyStore.PrivateKeyEntry) keystore.getEntry("testKeystore", protParam);

JarSigner signer = new JarSigner.Builder(pkEntry).build();
try (ZipFile in = new ZipFile(baseJarPath);
Expand Down

0 comments on commit 9d60665

Please sign in to comment.