Skip to content

Commit

Permalink
Merge pull request #5273 from Pandrex247/Revert-FISH-1323-Com
Browse files Browse the repository at this point in the history
Revert FISH-1323
  • Loading branch information
Pandrex247 authored May 26, 2021
2 parents 533c360 + 4f16b5b commit 4465fd5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
4 changes: 2 additions & 2 deletions appserver/extras/docker-images/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<docker.noCache>true</docker.noCache>

<docker.java.repository>azul/zulu-openjdk</docker.java.repository>
<docker.jdk8.tag>8u292</docker.jdk8.tag>
<docker.jdk11.tag>11.0.9</docker.jdk11.tag>
<docker.jdk8.tag>8u262</docker.jdk8.tag>
<docker.jdk11.tag>11.0.7</docker.jdk11.tag>

<docker.payara.domainName>domain1</docker.payara.domainName>
<docker.payara.rootDirectoryName>payara5</docker.payara.rootDirectoryName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import java.security.KeyPairGenerator;
import java.security.KeyStore;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.PrivateKey;
import java.security.Security;
import java.security.cert.Certificate;
Expand Down Expand Up @@ -100,14 +99,9 @@
@RunWith(Parameterized.class)
public class PrintCertificateCommandTest {

private static final BouncyCastleProvider PROVIDER = new BouncyCastleProvider();

private static final String ALIAS = "test";
private static final String KEYSTORE_PASSWORD = "changeit";

private static final String KS_TYPE_JKS = "JKS";
private static final String KS_TYPE_JCEKS = "JCEKS";
private static final String KS_TYPE_PKCS12 = "PKCS12";
private static final String KEYSTORE_PASSWORD = "changeit";

private static final File FILE_JKS = new File("target/pcct.jks");
private static final File FILE_PKCS12 = new File("target/pcct.p12");
Expand All @@ -134,9 +128,9 @@ public static void initEnvironment() throws Exception {
final KeyPair keyPair = createKeyPair();
final X509Certificate certificate = createSelfSignedCertificate(keyPair);

saveKeyStore(keyPair.getPrivate(), certificate, FILE_PKCS12, KS_TYPE_PKCS12);
saveKeyStore(keyPair.getPrivate(), certificate, FILE_JKS, KS_TYPE_JKS);
saveKeyStore(keyPair.getPrivate(), certificate, FILE_JCEKS, KS_TYPE_JCEKS);
saveKeyStore(keyPair.getPrivate(), certificate, FILE_PKCS12, "PKCS12");
saveKeyStore(keyPair.getPrivate(), certificate, FILE_JKS, "JKS");
saveKeyStore(keyPair.getPrivate(), certificate, FILE_JCEKS, "JCEKS");
saveDer(certificate);
savePem(certificate);
}
Expand Down Expand Up @@ -227,12 +221,7 @@ public void testBCProvider() throws Exception {
private static void saveKeyStore(final PrivateKey key, final X509Certificate certificate, //
final File keystoreFile, final String keystoreType) throws Exception {

final KeyStore keystore;
if (KS_TYPE_PKCS12.equals(keystoreType)) {
keystore = KeyStore.getInstance(keystoreType, PROVIDER);
} else {
keystore = KeyStore.getInstance(keystoreType);
}
final KeyStore keystore = KeyStore.getInstance(keystoreType);
keystore.load(null, null);
keystore.setKeyEntry(ALIAS, key, "changeit".toCharArray(), new Certificate[] {certificate});
try (final OutputStream os = new FileOutputStream(keystoreFile)) {
Expand All @@ -257,8 +246,8 @@ private static void savePem(final X509Certificate certificate) throws IOExceptio
}


private static KeyPair createKeyPair() throws NoSuchAlgorithmException, NoSuchProviderException {
final KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", PROVIDER);
private static KeyPair createKeyPair() throws NoSuchAlgorithmException {
final KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
kpg.initialize(2048);
return kpg.generateKeyPair();
}
Expand Down

0 comments on commit 4465fd5

Please sign in to comment.