List<X509Certificate> () { myReadLock.lock(); try { List<X509Certificate> certificates = new ArrayList<>(); for (String alias : Collections.list(myKeyStore.aliases())) { certificates.add(getCertificate(alias)); } return List.copyOf(certificates); } catch (Exception e) { LOG.error(e); return Collections.emptyList(); } finally { myReadLock.unlock(); } }