void (@NotNull String alias, @NotNull String clientKeyPath, @Nullable String clientCertPath, @Nullable char[] password) { try { PrivateKey key = SslUtil.readPrivateKey(clientKeyPath, password); List<X509Certificate> certificates = clientCertPath == null ? null : SslUtil.loadCertificates(clientCertPath); ourAdded.add(new KeyEntry(alias, key, certificates == null ? null : certificates.toArray(new Certificate[0]))); } catch (Exception e) { throw new IllegalStateException(e); } }