protected synchronized void removeAllDomainEntries() throws KeyStoreException
    {
        final String domainName = XMPPServer.getInstance().getServerInfo().getXMPPDomain();

        final Set<String> toDelete = new HashSet<>();
        for ( final String alias : Collections.list( store.aliases() ) )
        {
            final Certificate certificate = store.getCertificate( alias );
            if ( !( certificate instanceof X509Certificate ) )
            {
                continue;
            }

            for ( String identity : CertificateManager.getServerIdentities( (X509Certificate) certificate ) )
            {
                if ( DNSUtil.isNameCoveredByPattern( domainName, identity ) )
                {
                    toDelete.add( alias );
                    break;
                }
            }
        }

        for ( final String alias : toDelete )
        {
            store.deleteEntry( alias );
        }
    }
Removes all entries that reflect the local domain.

This method iterates over all entries, and removes those that match the domain of this server.

Note that the changes are not persisted by this method (as it is expected to be used in tandem with an insert.
@throws KeyStoreException if the key store could not be updated
xmppserver/src/main/java/org/jivesoftware/openfire/keystore/IdentityStore.java