diff --git a/shared/src/main/java/ca/weblite/jdeploy/factories/JDeployKeyProviderFactory.java b/shared/src/main/java/ca/weblite/jdeploy/factories/JDeployKeyProviderFactory.java index f9fdaf70..3185da29 100644 --- a/shared/src/main/java/ca/weblite/jdeploy/factories/JDeployKeyProviderFactory.java +++ b/shared/src/main/java/ca/weblite/jdeploy/factories/JDeployKeyProviderFactory.java @@ -13,6 +13,8 @@ public static interface KeyConfig { String getDeveloperId(); + String getCertificateAuthorityId(); + char[] getKeystorePassword(); } @@ -40,6 +42,15 @@ public String getDeveloperId() { return null; } + @Override + public String getCertificateAuthorityId() { + String envKeyStoreAlias = System.getenv("JDEPLOY_DEVELOPER_CA_ID"); + if (envKeyStoreAlias != null) { + return envKeyStoreAlias; + } + return null; + } + @Override public char[] getKeystorePassword() { String envKeyStorePassword = System.getenv("JDEPLOY_KEYSTORE_PASSWORD"); @@ -66,17 +77,29 @@ public KeyProvider createKeyProvider(KeyConfig config) { config.getKeystorePath(), config.getKeystorePassword(), config.getDeveloperId(), - config.getDeveloperId() + config.getDeveloperId(), + config.getCertificateAuthorityId() ) ); } if (Platform.getSystemPlatform().isMac() && config.getDeveloperId() != null) { - provider.registerKeyProvider(new MacKeyStoreKeyProvider(config.getDeveloperId(), null)); + provider.registerKeyProvider( + new MacKeyStoreKeyProvider( + config.getDeveloperId(), + null, + config.getCertificateAuthorityId() + ) + ); } if (Platform.getSystemPlatform().isWindows() && config.getDeveloperId() != null) { - provider.registerKeyProvider(new WindowsKeyStoreKeyProvider(config.getDeveloperId(), null)); + provider.registerKeyProvider( + new WindowsKeyStoreKeyProvider( + config.getDeveloperId(), + null, config.getCertificateAuthorityId() + ) + ); } return provider;