protected synchronized String generateUniqueAlias() throws CertificateStoreConfigException
    {
        final String domain = XMPPServer.getInstance().getServerInfo().getXMPPDomain();
        int index = 1;
        String alias = domain + "_" + index;
        try
        {
            while ( store.containsAlias( alias ) )
            {
                index = index + 1;
                alias = domain + "_" + index;
            }
            return alias;
        }
        catch ( KeyStoreException e )
        {
            throw new CertificateStoreConfigException( "Unable to generate a unique alias for this identity store.", e );
        }
    }
Generates an alias that is currently unused in this store.

@return An alias (never null).
@throws CertificateStoreConfigException if a unique alias could not be generated
xmppserver/src/main/java/org/jivesoftware/openfire/keystore/IdentityStore.java