@Test void testCreateKeyStoreHelper_createNewClient() throws Exception { TestUtils.setEnvironmentVariable(Address.SOCKET_ENV_VARIABLE, "unix:/tmp/test"); val options = getKeyStoreValidOptions(null); try { KeyStoreHelper.create(options); } catch (KeyStoreHelperException e) { fail(); } }
public static KeyStoreHelper create(@NonNull final KeyStoreOptions options) throws SocketEndpointAddressException, KeyStoreHelperException, KeyStoreException { if (options.keyStorePath.equals(options.trustStorePath)) { throw new KeyStoreHelperException("KeyStore and TrustStore should use different files"); } if (options.keyStoreType == null) { options.keyStoreType = KeyStoreType.getDefaultType(); } if (StringUtils.isBlank(options.keyAlias)) { options.keyAlias = DEFAULT_ALIAS; } val keyStore = createKeyStore(options, options.keyStorePath, options.keyStorePass); val trustStore = createKeyStore(options, options.trustStorePath, options.trustStorePass); if (options.workloadApiClient == null) { options.workloadApiClient = createNewClient(options.spiffeSocketPath); } return new KeyStoreHelper(keyStore, trustStore, options.keyPass, options.keyAlias, options.workloadApiClient); }
KeyStoreHelper implements Closeable { public static KeyStoreHelper create(@NonNull final KeyStoreOptions options) throws SocketEndpointAddressException, KeyStoreHelperException, KeyStoreException { if (options.keyStorePath.equals(options.trustStorePath)) { throw new KeyStoreHelperException("KeyStore and TrustStore should use different files"); } if (options.keyStoreType == null) { options.keyStoreType = KeyStoreType.getDefaultType(); } if (StringUtils.isBlank(options.keyAlias)) { options.keyAlias = DEFAULT_ALIAS; } val keyStore = createKeyStore(options, options.keyStorePath, options.keyStorePass); val trustStore = createKeyStore(options, options.trustStorePath, options.trustStorePass); if (options.workloadApiClient == null) { options.workloadApiClient = createNewClient(options.spiffeSocketPath); } return new KeyStoreHelper(keyStore, trustStore, options.keyPass, options.keyAlias, options.workloadApiClient); } }
KeyStoreHelper implements Closeable { public static KeyStoreHelper create(@NonNull final KeyStoreOptions options) throws SocketEndpointAddressException, KeyStoreHelperException, KeyStoreException { if (options.keyStorePath.equals(options.trustStorePath)) { throw new KeyStoreHelperException("KeyStore and TrustStore should use different files"); } if (options.keyStoreType == null) { options.keyStoreType = KeyStoreType.getDefaultType(); } if (StringUtils.isBlank(options.keyAlias)) { options.keyAlias = DEFAULT_ALIAS; } val keyStore = createKeyStore(options, options.keyStorePath, options.keyStorePass); val trustStore = createKeyStore(options, options.trustStorePath, options.trustStorePass); if (options.workloadApiClient == null) { options.workloadApiClient = createNewClient(options.spiffeSocketPath); } return new KeyStoreHelper(keyStore, trustStore, options.keyPass, options.keyAlias, options.workloadApiClient); } private  KeyStoreHelper(KeyStore keyStore, KeyStore trustStore, String keyPass, String keyAlias, WorkloadApiClient workloadApiClient); }
KeyStoreHelper implements Closeable { public static KeyStoreHelper create(@NonNull final KeyStoreOptions options) throws SocketEndpointAddressException, KeyStoreHelperException, KeyStoreException { if (options.keyStorePath.equals(options.trustStorePath)) { throw new KeyStoreHelperException("KeyStore and TrustStore should use different files"); } if (options.keyStoreType == null) { options.keyStoreType = KeyStoreType.getDefaultType(); } if (StringUtils.isBlank(options.keyAlias)) { options.keyAlias = DEFAULT_ALIAS; } val keyStore = createKeyStore(options, options.keyStorePath, options.keyStorePass); val trustStore = createKeyStore(options, options.trustStorePath, options.trustStorePass); if (options.workloadApiClient == null) { options.workloadApiClient = createNewClient(options.spiffeSocketPath); } return new KeyStoreHelper(keyStore, trustStore, options.keyPass, options.keyAlias, options.workloadApiClient); } private  KeyStoreHelper(KeyStore keyStore, KeyStore trustStore, String keyPass, String keyAlias, WorkloadApiClient workloadApiClient); static KeyStoreHelper create(@NonNull final KeyStoreOptions options); void run(boolean keepRunning); @SneakyThrows @Override void close(); }
KeyStoreHelper implements Closeable { public static KeyStoreHelper create(@NonNull final KeyStoreOptions options) throws SocketEndpointAddressException, KeyStoreHelperException, KeyStoreException { if (options.keyStorePath.equals(options.trustStorePath)) { throw new KeyStoreHelperException("KeyStore and TrustStore should use different files"); } if (options.keyStoreType == null) { options.keyStoreType = KeyStoreType.getDefaultType(); } if (StringUtils.isBlank(options.keyAlias)) { options.keyAlias = DEFAULT_ALIAS; } val keyStore = createKeyStore(options, options.keyStorePath, options.keyStorePass); val trustStore = createKeyStore(options, options.trustStorePath, options.trustStorePass); if (options.workloadApiClient == null) { options.workloadApiClient = createNewClient(options.spiffeSocketPath); } return new KeyStoreHelper(keyStore, trustStore, options.keyPass, options.keyAlias, options.workloadApiClient); } private  KeyStoreHelper(KeyStore keyStore, KeyStore trustStore, String keyPass, String keyAlias, WorkloadApiClient workloadApiClient); static KeyStoreHelper create(@NonNull final KeyStoreOptions options); void run(boolean keepRunning); @SneakyThrows @Override void close();  }