@Test public void testKeyPairAlgorithm() throws CommandLineParseException, IOException { String testAlgorithm = "testAlgorithm"; tlsCertificateAuthorityServiceCommandLine.parse("-t", testToken, "-a", testAlgorithm); assertEquals(testAlgorithm, tlsCertificateAuthorityServiceCommandLine.createConfig().getKeyPairAlgorithm()); }
public TlsConfig createConfig() throws IOException { String configJsonIn = getConfigJsonIn(); if (!StringUtils.isEmpty(configJsonIn)) { try (InputStream inputStream = inputStreamFactory.create(new File(configJsonIn))) { TlsConfig tlsConfig = new ObjectMapper().readValue(inputStream, TlsConfig.class); tlsConfig.initDefaults(); return tlsConfig; } } else { TlsConfig tlsConfig = new TlsConfig(); tlsConfig.setCaHostname(getCertificateAuthorityHostname()); tlsConfig.setDn(getDn()); tlsConfig.setToken(getToken()); tlsConfig.setPort(getPort()); tlsConfig.setKeyStore(NIFI_CA_KEYSTORE + getKeyStoreType().toLowerCase()); tlsConfig.setKeyStoreType(getKeyStoreType()); tlsConfig.setKeySize(getKeySize()); tlsConfig.setKeyPairAlgorithm(getKeyAlgorithm()); tlsConfig.setSigningAlgorithm(getSigningAlgorithm()); tlsConfig.setDays(getDays()); return tlsConfig; } }
TlsCertificateAuthorityServiceCommandLine extends BaseCertificateAuthorityCommandLine { public TlsConfig createConfig() throws IOException { String configJsonIn = getConfigJsonIn(); if (!StringUtils.isEmpty(configJsonIn)) { try (InputStream inputStream = inputStreamFactory.create(new File(configJsonIn))) { TlsConfig tlsConfig = new ObjectMapper().readValue(inputStream, TlsConfig.class); tlsConfig.initDefaults(); return tlsConfig; } } else { TlsConfig tlsConfig = new TlsConfig(); tlsConfig.setCaHostname(getCertificateAuthorityHostname()); tlsConfig.setDn(getDn()); tlsConfig.setToken(getToken()); tlsConfig.setPort(getPort()); tlsConfig.setKeyStore(NIFI_CA_KEYSTORE + getKeyStoreType().toLowerCase()); tlsConfig.setKeyStoreType(getKeyStoreType()); tlsConfig.setKeySize(getKeySize()); tlsConfig.setKeyPairAlgorithm(getKeyAlgorithm()); tlsConfig.setSigningAlgorithm(getSigningAlgorithm()); tlsConfig.setDays(getDays()); return tlsConfig; } } }
TlsCertificateAuthorityServiceCommandLine extends BaseCertificateAuthorityCommandLine { public TlsConfig createConfig() throws IOException { String configJsonIn = getConfigJsonIn(); if (!StringUtils.isEmpty(configJsonIn)) { try (InputStream inputStream = inputStreamFactory.create(new File(configJsonIn))) { TlsConfig tlsConfig = new ObjectMapper().readValue(inputStream, TlsConfig.class); tlsConfig.initDefaults(); return tlsConfig; } } else { TlsConfig tlsConfig = new TlsConfig(); tlsConfig.setCaHostname(getCertificateAuthorityHostname()); tlsConfig.setDn(getDn()); tlsConfig.setToken(getToken()); tlsConfig.setPort(getPort()); tlsConfig.setKeyStore(NIFI_CA_KEYSTORE + getKeyStoreType().toLowerCase()); tlsConfig.setKeyStoreType(getKeyStoreType()); tlsConfig.setKeySize(getKeySize()); tlsConfig.setKeyPairAlgorithm(getKeyAlgorithm()); tlsConfig.setSigningAlgorithm(getSigningAlgorithm()); tlsConfig.setDays(getDays()); return tlsConfig; } } TlsCertificateAuthorityServiceCommandLine();  TlsCertificateAuthorityServiceCommandLine(InputStreamFactory inputStreamFactory); }
TlsCertificateAuthorityServiceCommandLine extends BaseCertificateAuthorityCommandLine { public TlsConfig createConfig() throws IOException { String configJsonIn = getConfigJsonIn(); if (!StringUtils.isEmpty(configJsonIn)) { try (InputStream inputStream = inputStreamFactory.create(new File(configJsonIn))) { TlsConfig tlsConfig = new ObjectMapper().readValue(inputStream, TlsConfig.class); tlsConfig.initDefaults(); return tlsConfig; } } else { TlsConfig tlsConfig = new TlsConfig(); tlsConfig.setCaHostname(getCertificateAuthorityHostname()); tlsConfig.setDn(getDn()); tlsConfig.setToken(getToken()); tlsConfig.setPort(getPort()); tlsConfig.setKeyStore(NIFI_CA_KEYSTORE + getKeyStoreType().toLowerCase()); tlsConfig.setKeyStoreType(getKeyStoreType()); tlsConfig.setKeySize(getKeySize()); tlsConfig.setKeyPairAlgorithm(getKeyAlgorithm()); tlsConfig.setSigningAlgorithm(getSigningAlgorithm()); tlsConfig.setDays(getDays()); return tlsConfig; } } TlsCertificateAuthorityServiceCommandLine();  TlsCertificateAuthorityServiceCommandLine(InputStreamFactory inputStreamFactory); static void main(String[] args); TlsConfig createConfig(); }
TlsCertificateAuthorityServiceCommandLine extends BaseCertificateAuthorityCommandLine { public TlsConfig createConfig() throws IOException { String configJsonIn = getConfigJsonIn(); if (!StringUtils.isEmpty(configJsonIn)) { try (InputStream inputStream = inputStreamFactory.create(new File(configJsonIn))) { TlsConfig tlsConfig = new ObjectMapper().readValue(inputStream, TlsConfig.class); tlsConfig.initDefaults(); return tlsConfig; } } else { TlsConfig tlsConfig = new TlsConfig(); tlsConfig.setCaHostname(getCertificateAuthorityHostname()); tlsConfig.setDn(getDn()); tlsConfig.setToken(getToken()); tlsConfig.setPort(getPort()); tlsConfig.setKeyStore(NIFI_CA_KEYSTORE + getKeyStoreType().toLowerCase()); tlsConfig.setKeyStoreType(getKeyStoreType()); tlsConfig.setKeySize(getKeySize()); tlsConfig.setKeyPairAlgorithm(getKeyAlgorithm()); tlsConfig.setSigningAlgorithm(getSigningAlgorithm()); tlsConfig.setDays(getDays()); return tlsConfig; } } TlsCertificateAuthorityServiceCommandLine();  TlsCertificateAuthorityServiceCommandLine(InputStreamFactory inputStreamFactory); static void main(String[] args); TlsConfig createConfig(); static final String DESCRIPTION; static final String NIFI_CA_KEYSTORE; }