boolean (@NotNull X509Certificate certificate) { myWriteLock.lock(); try { if (isBroken()) { return false; } myKeyStore.setCertificateEntry(createAlias(certificate), certificate); flushKeyStore(); LOG.info("Added certificate for '" + certificate.getSubjectX500Principal().toString() + "' to " + myPath); // trust manager should be updated each time its key store was modified myTrustManager = initFactoryAndGetManager(); myDispatcher.getMulticaster().certificateAdded(certificate); return true; } catch (Exception e) { LOG.error("Cannot add certificate", e); return false; } finally { myWriteLock.unlock(); } }