/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.common.io.CertUtils
 *  com.l7tech.common.password.IncorrectPasswordException
 *  com.l7tech.common.password.PasswordHasher
 *  com.l7tech.gateway.common.admin.IdentityAdmin
 *  com.l7tech.gateway.common.admin.IdentityAdmin$AccountMinimums
 *  com.l7tech.gateway.common.audit.Audit
 *  com.l7tech.gateway.common.audit.LoggingAudit
 *  com.l7tech.gateway.common.security.keystore.SsgKeyEntry
 *  com.l7tech.gateway.common.security.rbac.Role
 *  com.l7tech.identity.AuthenticationException
 *  com.l7tech.identity.Group
 *  com.l7tech.identity.GroupBean
 *  com.l7tech.identity.GroupManager
 *  com.l7tech.identity.IdentityProvider
 *  com.l7tech.identity.IdentityProviderConfig
 *  com.l7tech.identity.IdentityProviderConfigManager
 *  com.l7tech.identity.IdentityProviderPasswordPolicy
 *  com.l7tech.identity.IdentityProviderPasswordPolicyManager
 *  com.l7tech.identity.IdentityProviderType
 *  com.l7tech.identity.InvalidIdProviderCfgException
 *  com.l7tech.identity.LogonInfo
 *  com.l7tech.identity.LogonInfo$State
 *  com.l7tech.identity.User
 *  com.l7tech.identity.UserBean
 *  com.l7tech.identity.UserManager
 *  com.l7tech.identity.cert.ClientCertManager
 *  com.l7tech.identity.cert.ClientCertManager$CertInfo
 *  com.l7tech.identity.fed.FederatedUser
 *  com.l7tech.identity.internal.InternalUser
 *  com.l7tech.identity.ldap.LdapIdentityProviderConfig
 *  com.l7tech.ntlm.adapter.NetlogonAdapter
 *  com.l7tech.ntlm.protocol.AuthenticationManagerException
 *  com.l7tech.objectmodel.DeleteException
 *  com.l7tech.objectmodel.EntityHeader
 *  com.l7tech.objectmodel.EntityHeaderSet
 *  com.l7tech.objectmodel.EntityType
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.IdentityHeader
 *  com.l7tech.objectmodel.InvalidPasswordException
 *  com.l7tech.objectmodel.ObjectModelException
 *  com.l7tech.objectmodel.ObjectNotFoundException
 *  com.l7tech.objectmodel.PersistentEntity
 *  com.l7tech.objectmodel.SaveException
 *  com.l7tech.objectmodel.UpdateException
 *  com.l7tech.util.Charsets
 *  com.l7tech.util.Config
 *  com.l7tech.util.Functions
 *  com.l7tech.util.Functions$Binary
 *  com.l7tech.util.Functions$Unary
 *  com.l7tech.util.GoidUpgradeMapper
 *  com.l7tech.util.HexUtils
 *  com.l7tech.util.Pair
 *  jakarta.inject.Inject
 *  org.apache.commons.collections.CollectionUtils
 *  org.jetbrains.annotations.NotNull
 *  org.jetbrains.annotations.Nullable
 *  org.springframework.context.ApplicationEvent
 *  org.springframework.context.ApplicationEventPublisher
 *  org.springframework.context.ApplicationEventPublisherAware
 */
package com.l7tech.server.identity;

import com.l7tech.common.io.CertUtils;
import com.l7tech.common.password.IncorrectPasswordException;
import com.l7tech.common.password.PasswordHasher;
import com.l7tech.gateway.common.admin.IdentityAdmin;
import com.l7tech.gateway.common.audit.Audit;
import com.l7tech.gateway.common.audit.LoggingAudit;
import com.l7tech.gateway.common.security.keystore.SsgKeyEntry;
import com.l7tech.gateway.common.security.rbac.Role;
import com.l7tech.identity.AuthenticationException;
import com.l7tech.identity.Group;
import com.l7tech.identity.GroupBean;
import com.l7tech.identity.GroupManager;
import com.l7tech.identity.IdentityProvider;
import com.l7tech.identity.IdentityProviderConfig;
import com.l7tech.identity.IdentityProviderConfigManager;
import com.l7tech.identity.IdentityProviderPasswordPolicy;
import com.l7tech.identity.IdentityProviderPasswordPolicyManager;
import com.l7tech.identity.IdentityProviderType;
import com.l7tech.identity.InvalidIdProviderCfgException;
import com.l7tech.identity.LogonInfo;
import com.l7tech.identity.User;
import com.l7tech.identity.UserBean;
import com.l7tech.identity.UserManager;
import com.l7tech.identity.cert.ClientCertManager;
import com.l7tech.identity.fed.FederatedUser;
import com.l7tech.identity.internal.InternalUser;
import com.l7tech.identity.ldap.LdapIdentityProviderConfig;
import com.l7tech.ntlm.adapter.NetlogonAdapter;
import com.l7tech.ntlm.protocol.AuthenticationManagerException;
import com.l7tech.objectmodel.DeleteException;
import com.l7tech.objectmodel.EntityHeader;
import com.l7tech.objectmodel.EntityHeaderSet;
import com.l7tech.objectmodel.EntityType;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.IdentityHeader;
import com.l7tech.objectmodel.InvalidPasswordException;
import com.l7tech.objectmodel.ObjectModelException;
import com.l7tech.objectmodel.ObjectNotFoundException;
import com.l7tech.objectmodel.PersistentEntity;
import com.l7tech.objectmodel.SaveException;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.server.DefaultKey;
import com.l7tech.server.event.admin.AdminEvent;
import com.l7tech.server.event.admin.AdministrativePasswordsResetEvent;
import com.l7tech.server.event.admin.AuditRevokeAllUserCertificates;
import com.l7tech.server.identity.IdentityProviderFactory;
import com.l7tech.server.identity.h;
import com.l7tech.server.identity.i;
import com.l7tech.server.identity.internal.InternalIdentityProvider;
import com.l7tech.server.identity.internal.InternalUserManager;
import com.l7tech.server.identity.internal.InternalUserPasswordManager;
import com.l7tech.server.identity.j;
import com.l7tech.server.identity.ldap.LdapConfigTemplateManager;
import com.l7tech.server.logon.LogonInfoManager;
import com.l7tech.server.policy.variable.ServerVariables;
import com.l7tech.server.security.PasswordEnforcerManager;
import com.l7tech.server.security.rbac.RoleManager;
import com.l7tech.server.util.JaasUtils;
import com.l7tech.util.Charsets;
import com.l7tech.util.Config;
import com.l7tech.util.Functions;
import com.l7tech.util.GoidUpgradeMapper;
import com.l7tech.util.HexUtils;
import com.l7tech.util.Pair;
import jakarta.inject.Inject;
import java.security.SecureRandom;
import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.security.auth.x500.X500Principal;
import org.apache.commons.collections.CollectionUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;

public class IdentityAdminImpl
implements ApplicationEventPublisherAware,
IdentityAdmin {
    private ClientCertManager a;
    private final RoleManager b;
    private final DefaultKey c;
    private ApplicationEventPublisher d;
    private final PasswordEnforcerManager e;
    private final IdentityProviderPasswordPolicyManager f;
    private LogonInfoManager g;
    private final PasswordHasher h;
    private final Collection<Pair<IdentityAdmin.AccountMinimums, IdentityProviderPasswordPolicy>> i;
    @Inject
    private Config config;
    private static final String j;
    private static final SecureRandom k;
    private IdentityProviderConfigManager l;
    private IdentityProviderFactory m;
    private LdapConfigTemplateManager n;
    private final Logger o = Logger.getLogger(this.getClass().getName());
    static final /* synthetic */ boolean p;
    private static final String[] q;

    public IdentityAdminImpl(RoleManager roleManager, IdentityProviderPasswordPolicyManager identityProviderPasswordPolicyManager, PasswordEnforcerManager passwordEnforcerManager, DefaultKey defaultKey, PasswordHasher passwordHasher, Collection<Pair<IdentityAdmin.AccountMinimums, IdentityProviderPasswordPolicy>> collection, LdapConfigTemplateManager ldapConfigTemplateManager) {
        if (roleManager == null) {
            throw new IllegalArgumentException(q[35]);
        }
        this.b = roleManager;
        this.c = defaultKey;
        this.f = identityProviderPasswordPolicyManager;
        this.e = passwordEnforcerManager;
        this.h = passwordHasher;
        this.i = collection;
        this.n = ldapConfigTemplateManager;
    }

    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
        try {
            if (this.d != null) {
                throw new IllegalStateException(q[70]);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw IdentityAdminImpl.a(illegalArgumentException);
        }
        this.d = applicationEventPublisher;
    }

    public EntityHeader[] findAllIdentityProviderConfig() throws FindException {
        Collection collection = this.e().findAllHeaders();
        return collection.toArray(new EntityHeader[collection.size()]);
    }

    public IdentityProviderConfig findIdentityProviderConfigByID(Goid goid) throws FindException {
        return (IdentityProviderConfig)this.e().findByPrimaryKey(goid);
    }

    public Goid saveIdentityProviderConfig(IdentityProviderConfig identityProviderConfig) throws SaveException, UpdateException {
        try {
            Goid goid;
            if (!Goid.isDefault((Goid)identityProviderConfig.getGoid())) {
                IdentityProviderConfigManager identityProviderConfigManager = this.e();
                IdentityProviderConfig identityProviderConfig2 = (IdentityProviderConfig)identityProviderConfigManager.findByPrimaryKey(identityProviderConfig.getGoid());
                try {
                    if (identityProviderConfig2 == null) {
                        throw new SaveException(q[48] + String.valueOf(identityProviderConfig.getGoid()) + q[13]);
                    }
                }
                catch (FindException findException) {
                    throw IdentityAdminImpl.a((Exception)((Object)findException));
                }
                identityProviderConfig2.copyFrom(identityProviderConfig);
                identityProviderConfigManager.update((PersistentEntity)identityProviderConfig2);
                String[] stringArray = q;
                this.o.info(stringArray[55] + String.valueOf(identityProviderConfig.getGoid()));
                goid = identityProviderConfig.getGoid();
            } else {
                String[] stringArray = q;
                this.o.info(stringArray[60] + String.valueOf(identityProviderConfig.getGoid()));
                goid = this.e().save((PersistentEntity)identityProviderConfig);
                this.e().createRoles((PersistentEntity)identityProviderConfig);
            }
            return goid;
        }
        catch (FindException findException) {
            this.o.log(Level.SEVERE, null, findException);
            throw new UpdateException(q[68], (Throwable)findException);
        }
    }

    private void a(Goid goid) throws DeleteException {
        try {
            UserManager userManager = this.d(goid);
            try {
                if (userManager == null) {
                    throw new DeleteException(q[59]);
                }
            }
            catch (FindException findException) {
                throw IdentityAdminImpl.a((Exception)((Object)findException));
            }
            userManager.deleteAll(goid);
        }
        catch (FindException findException) {
            throw new DeleteException(q[30], (Throwable)findException);
        }
    }

    private void b(Goid goid) throws DeleteException {
        try {
            GroupManager<?, ?> groupManager = this.e(goid);
            try {
                if (groupManager == null) {
                    throw new DeleteException(q[2]);
                }
            }
            catch (ObjectNotFoundException objectNotFoundException) {
                throw IdentityAdminImpl.a((Exception)((Object)objectNotFoundException));
            }
            groupManager.deleteAll(goid);
        }
        catch (ObjectNotFoundException objectNotFoundException) {
            throw new DeleteException(q[68], (Throwable)objectNotFoundException);
        }
        catch (FindException findException) {
            throw new DeleteException(findException.getMessage(), (Throwable)findException);
        }
    }

    private void c(Goid goid) throws DeleteException {
        try {
            GroupManager<?, ?> groupManager = this.e(goid);
            try {
                if (groupManager == null) {
                    throw new DeleteException(q[12]);
                }
            }
            catch (ObjectNotFoundException objectNotFoundException) {
                throw IdentityAdminImpl.a((Exception)((Object)objectNotFoundException));
            }
            groupManager.deleteAllVirtual(goid);
        }
        catch (ObjectNotFoundException objectNotFoundException) {
            throw new DeleteException(q[68], (Throwable)objectNotFoundException);
        }
        catch (FindException findException) {
            throw new DeleteException(findException.getMessage(), (Throwable)findException);
        }
    }

    public void deleteIdentityProviderConfig(Goid goid) throws DeleteException {
        try {
            IdentityProviderConfigManager identityProviderConfigManager = this.e();
            IdentityProviderConfig identityProviderConfig = (IdentityProviderConfig)identityProviderConfigManager.findByPrimaryKey(goid);
            try {
                if (identityProviderConfig == null) {
                    throw new DeleteException(q[76] + String.valueOf(goid) + q[56]);
                }
            }
            catch (FindException findException) {
                throw IdentityAdminImpl.a((Exception)((Object)findException));
            }
            try {
                if (identityProviderConfig.type() == IdentityProviderType.FEDERATED) {
                    this.a(goid);
                    this.b(goid);
                    this.c(goid);
                }
            }
            catch (FindException findException) {
                throw IdentityAdminImpl.a((Exception)((Object)findException));
            }
            identityProviderConfigManager.delete((PersistentEntity)identityProviderConfig);
            String[] stringArray = q;
            this.o.info(stringArray[23] + String.valueOf(identityProviderConfig));
        }
        catch (FindException findException) {
            this.o.log(Level.SEVERE, null, findException);
            throw new DeleteException(q[1], (Throwable)findException);
        }
    }

    public EntityHeaderSet<IdentityHeader> findAllUsers(Goid goid) throws FindException {
        UserManager userManager = this.d(goid);
        return userManager.findAllHeaders();
    }

    public EntityHeaderSet<IdentityHeader> searchIdentities(Goid goid, EntityType[] entityTypeArray, String string) throws FindException {
        IdentityProvider identityProvider = this.m.getProvider(goid);
        try {
            if (identityProvider == null) {
                throw new FindException(q[22]);
            }
        }
        catch (FindException findException) {
            throw IdentityAdminImpl.a((Exception)((Object)findException));
        }
        return identityProvider.search(entityTypeArray, string);
    }

    public User findUserByID(Goid goid, String string) throws FindException {
        IdentityProvider identityProvider = this.m.getProvider(goid);
        try {
            if (identityProvider == null) {
                this.o.warning(q[5] + String.valueOf(goid) + q[32]);
                return null;
            }
        }
        catch (FindException findException) {
            throw IdentityAdminImpl.a((Exception)((Object)findException));
        }
        UserManager userManager = identityProvider.getUserManager();
        User user = userManager.findByPrimaryKey(string);
        if (user instanceof InternalUser) {
            user = this.a((InternalUser)user);
        }
        return user;
    }

    public User findUserByLogin(Goid goid, String string) throws FindException {
        IdentityProvider identityProvider = this.m.getProvider(goid);
        try {
            if (identityProvider == null) {
                this.o.warning(q[5] + String.valueOf(goid) + q[32]);
                return null;
            }
        }
        catch (FindException findException) {
            throw IdentityAdminImpl.a((Exception)((Object)findException));
        }
        UserManager userManager = identityProvider.getUserManager();
        User user = userManager.findByLogin(string);
        if (user instanceof InternalUser) {
            user = this.a((InternalUser)user);
        }
        return user;
    }

    public void deleteUser(Goid goid, String string) throws DeleteException, ObjectNotFoundException {
        try {
            UserManager userManager = this.d(goid);
            try {
                if (userManager == null) {
                    throw new DeleteException(q[38]);
                }
            }
            catch (FindException findException) {
                throw IdentityAdminImpl.a((Exception)((Object)findException));
            }
            User user = userManager.findByPrimaryKey(string);
            try {
                if (user == null) {
                    throw new ObjectNotFoundException(q[78] + string);
                }
            }
            catch (FindException findException) {
                throw IdentityAdminImpl.a((Exception)((Object)findException));
            }
            try {
                if (user.equals((Object)JaasUtils.getCurrentUser())) {
                    throw new DeleteException(q[39]);
                }
            }
            catch (FindException findException) {
                throw IdentityAdminImpl.a((Exception)((Object)findException));
            }
            userManager.delete(user);
            String[] stringArray = q;
            this.o.info(stringArray[8] + user.getLogin());
        }
        catch (FindException findException) {
            this.o.log(Level.SEVERE, null, findException);
            throw new DeleteException(q[68], (Throwable)findException);
        }
    }

    public String saveUser(Goid goid, User user, Set<IdentityHeader> set) throws SaveException, UpdateException, ObjectNotFoundException {
        try {
            return this.saveUser(goid, user, set, null);
        }
        catch (InvalidPasswordException invalidPasswordException) {
            throw new IllegalStateException(q[63]);
        }
    }

    /*
     * Unable to fully structure code
     */
    public String saveUser(Goid var1_1, User var2_2, Set var3_3, @Nullable String var4_4) throws SaveException, UpdateException, ObjectNotFoundException, InvalidPasswordException {
        var5_5 = true;
        try {
            block25: {
                block24: {
                    block23: {
                        block22: {
                            var6_6 = var2_2.getId();
                            if (var6_6 == null) ** GOTO lbl11
                            try {
                                block26: {
                                    if (!IdentityAdminImpl.j.equals(var6_6)) break block22;
                                    break block26;
                                    catch (FindException v0) {
                                        throw IdentityAdminImpl.a((Exception)v0);
                                    }
                                }
                                v1 = true;
                                break block23;
                            }
                            catch (FindException v2) {
                                throw IdentityAdminImpl.a((Exception)v2);
                            }
                        }
                        v1 = false;
                    }
                    var5_5 = v1;
                    var7_8 = this.m.getProvider(var1_1);
                    try {
                        if (var7_8 == null) {
                            throw new FindException(IdentityAdminImpl.q[27]);
                        }
                    }
                    catch (FindException v3) {
                        throw IdentityAdminImpl.a((Exception)v3);
                    }
                    var8_9 = var7_8.getUserManager();
                    if (var2_2 instanceof UserBean) {
                        var2_2 = var8_9.reify((UserBean)var2_2);
                    }
                    if (!(var2_2 instanceof InternalUser)) break block25;
                    var9_10 = (InternalUser)var2_2;
                    try {
                        if (var5_5) break block24;
                        this.b(var9_10);
                        this.a(var9_10, (InternalUser)var8_9.findByPrimaryKey(var9_10.getId()));
                        break block25;
                    }
                    catch (FindException v4) {
                        throw IdentityAdminImpl.a((Exception)v4);
                    }
                }
                this.e.isPasswordPolicyCompliant(var4_4);
                this.e.setUserPasswordPolicyAttributes(var9_10, true);
                var10_11 = (InternalUserManager)var8_9;
                var11_12 = var10_11.getUserPasswordManager();
                var12_13 = var11_12.configureUserPasswordHashes(var9_10, var4_4);
                if (IdentityAdminImpl.p) break block25;
                try {
                    block27: {
                        if (var12_13) break block25;
                        break block27;
                        catch (FindException v5) {
                            throw IdentityAdminImpl.a((Exception)v5);
                        }
                    }
                    throw new AssertionError();
                }
                catch (FindException v6) {
                    throw IdentityAdminImpl.a((Exception)v6);
                }
            }
            if (var2_2 instanceof FederatedUser) {
                var9_10 = (FederatedUser)var2_2;
                var9_10.setSubjectDn(CertUtils.formatDN((String)var9_10.getSubjectDn()));
            }
            if (var5_5) {
                var6_6 = var8_9.save(var2_2, var3_3);
                var13_14 = IdentityAdminImpl.q;
                this.o.info(var13_14[62] + var2_2.getLogin() + var13_14[72] + var6_6 + "]");
            } else {
                var8_9.update(var2_2, var3_3);
                var13_15 = IdentityAdminImpl.q;
                this.o.info(var13_15[51] + var2_2.getLogin() + var13_15[72] + var6_6 + "]");
            }
            return var6_6;
        }
        catch (FindException var6_7) {
            try {
                this.o.log(Level.SEVERE, null, var6_7);
                if (var5_5) {
                    throw new SaveException(IdentityAdminImpl.q[82], (Throwable)var6_7);
                }
            }
            catch (FindException v7) {
                throw IdentityAdminImpl.a((Exception)v7);
            }
            throw new UpdateException(IdentityAdminImpl.q[58], (Throwable)var6_7);
        }
    }

    /*
     * Loose catch block
     * Enabled force condition propagation
     * Lifted jumps to return sites
     */
    public void changeUsersPassword(User user, String string) throws FindException, UpdateException, InvalidPasswordException {
        IdentityProvider identityProvider;
        block16: {
            identityProvider = this.m.getProvider(user.getProviderId());
            try {
                if (identityProvider == null) {
                    throw new FindException(q[27]);
                }
            }
            catch (IncorrectPasswordException incorrectPasswordException) {
                throw IdentityAdminImpl.a((Exception)((Object)incorrectPasswordException));
            }
            try {
                if (!(identityProvider instanceof InternalIdentityProvider)) {
                    throw new UpdateException(q[45]);
                }
            }
            catch (IncorrectPasswordException incorrectPasswordException) {
                throw IdentityAdminImpl.a((Exception)((Object)incorrectPasswordException));
            }
            if (string == null) throw new InvalidPasswordException(q[16]);
            try {
                if (!string.trim().isEmpty()) break block16;
                throw new InvalidPasswordException(q[16]);
                catch (IncorrectPasswordException incorrectPasswordException) {
                    throw IdentityAdminImpl.a((Exception)((Object)incorrectPasswordException));
                }
            }
            catch (IncorrectPasswordException incorrectPasswordException) {
                throw IdentityAdminImpl.a((Exception)((Object)incorrectPasswordException));
            }
        }
        InternalUserManager internalUserManager = (InternalUserManager)identityProvider.getUserManager();
        InternalUser internalUser = new InternalUser();
        InternalUser internalUser2 = (InternalUser)internalUserManager.findByPrimaryKey(String.valueOf(user.getId()));
        internalUser.copyFrom((User)internalUser2);
        internalUser.setVersion(internalUser2.getVersion());
        String string2 = internalUser.getHashedPassword();
        if (this.h.isVerifierRecognized(string2)) {
            try {
                this.h.verifyPassword(string.getBytes(Charsets.UTF8), string2);
                String[] stringArray = q;
                throw new InvalidPasswordException(stringArray[44]);
            }
            catch (IncorrectPasswordException incorrectPasswordException) {
                // empty catch block
            }
        }
        this.e.isPasswordPolicyCompliant(string);
        InternalUserPasswordManager internalUserPasswordManager = internalUserManager.getUserPasswordManager();
        boolean bl2 = internalUserPasswordManager.configureUserPasswordHashes(internalUser, string);
        try {
            if (!bl2) {
                throw new IllegalStateException(q[31]);
            }
        }
        catch (IncorrectPasswordException incorrectPasswordException) {
            throw IdentityAdminImpl.a((Exception)((Object)incorrectPasswordException));
        }
        this.e.setUserPasswordPolicyAttributes(internalUser, true);
        String[] stringArray = q;
        this.o.info(stringArray[17] + internalUser.getLogin() + stringArray[19] + String.valueOf(internalUser.getGoid()) + "]");
        this.activateUser((User)internalUser);
        internalUserManager.update((User)internalUser);
    }

    public EntityHeaderSet<IdentityHeader> findAllGroups(Goid goid) throws FindException {
        return this.e(goid).findAllHeaders();
    }

    public Group findGroupByID(Goid goid, String string) throws FindException {
        IdentityProvider identityProvider = this.m.getProvider(goid);
        try {
            if (identityProvider == null) {
                this.o.warning(q[50] + String.valueOf(goid) + q[42]);
                return null;
            }
        }
        catch (FindException findException) {
            throw IdentityAdminImpl.a((Exception)((Object)findException));
        }
        GroupManager groupManager = identityProvider.getGroupManager();
        return groupManager.findByPrimaryKey(string);
    }

    public Group findGroupByName(Goid goid, String string) throws FindException {
        IdentityProvider identityProvider = this.m.getProvider(goid);
        try {
            if (identityProvider == null) {
                this.o.warning(q[5] + String.valueOf(goid) + q[32]);
                return null;
            }
        }
        catch (FindException findException) {
            throw IdentityAdminImpl.a((Exception)((Object)findException));
        }
        GroupManager groupManager = identityProvider.getGroupManager();
        return groupManager.findByName(string);
    }

    public void deleteGroup(Goid goid, String string) throws DeleteException, ObjectNotFoundException {
        try {
            GroupManager<?, ?> groupManager = this.e(goid);
            Group group = groupManager.findByPrimaryKey(string);
            try {
                if (group == null) {
                    throw new ObjectNotFoundException(q[71]);
                }
            }
            catch (FindException findException) {
                throw IdentityAdminImpl.a((Exception)((Object)findException));
            }
            groupManager.delete(group);
            String[] stringArray = q;
            this.o.info(stringArray[3] + group.getName());
        }
        catch (FindException findException) {
            throw new DeleteException(q[68], (Throwable)findException);
        }
    }

    /*
     * Unable to fully structure code
     */
    public String saveGroup(Goid var1_1, Group var2_2, Set<IdentityHeader> var3_3) throws SaveException, UpdateException, ObjectNotFoundException {
        var4_4 = true;
        try {
            block16: {
                block15: {
                    var5_5 = var2_2.getId();
                    if (var5_5 == null) ** GOTO lbl11
                    try {
                        block17: {
                            if (!var5_5.equals(IdentityAdminImpl.j)) break block15;
                            break block17;
                            catch (FindException v0) {
                                throw IdentityAdminImpl.a((Exception)v0);
                            }
                        }
                        v1 = true;
                        break block16;
                    }
                    catch (FindException v2) {
                        throw IdentityAdminImpl.a((Exception)v2);
                    }
                }
                v1 = false;
            }
            var4_4 = v1;
            var6_7 = this.m.getProvider(var1_1);
            try {
                if (var6_7 == null) {
                    throw new FindException(IdentityAdminImpl.q[27]);
                }
            }
            catch (FindException v3) {
                throw IdentityAdminImpl.a((Exception)v3);
            }
            var7_8 = var6_7.getGroupManager();
            if (var2_2 instanceof GroupBean) {
                var2_2 = var7_8.reify((GroupBean)var2_2);
            }
            if (var4_4) {
                var5_5 = var7_8.save(var2_2, var3_3);
                var8_9 = IdentityAdminImpl.q;
                this.o.info(var8_9[28] + var2_2.getName() + var8_9[72] + var5_5 + "]");
            } else {
                var7_8.update(var2_2, var3_3);
                var8_10 = IdentityAdminImpl.q;
                this.o.info(var8_10[64] + var2_2.getName() + var8_10[72] + var5_5 + "]");
            }
            return var5_5;
        }
        catch (FindException var5_6) {
            try {
                this.o.log(Level.SEVERE, null, var5_6);
                if (var4_4) {
                    throw new SaveException(IdentityAdminImpl.q[54], (Throwable)var5_6);
                }
            }
            catch (FindException v4) {
                throw IdentityAdminImpl.a((Exception)v4);
            }
            throw new UpdateException(IdentityAdminImpl.q[57], (Throwable)var5_6);
        }
    }

    public String getUserCert(User user) throws FindException, CertificateEncodingException {
        Certificate certificate = this.a.getUserCert(user);
        try {
            if (certificate == null) {
                return null;
            }
        }
        catch (FindException findException) {
            throw IdentityAdminImpl.a((Exception)((Object)findException));
        }
        return HexUtils.encodeBase64((byte[])certificate.getEncoded());
    }

    public boolean doesCurrentUserHaveCert() throws FindException, AuthenticationException {
        User user = JaasUtils.getCurrentUser();
        try {
            if (user == null) {
                throw new AuthenticationException(q[11]);
            }
        }
        catch (FindException findException) {
            throw IdentityAdminImpl.a((Exception)((Object)findException));
        }
        IdentityProvider identityProvider = this.m.getProvider(user.getProviderId());
        return identityProvider.hasClientCert(user.getLogin());
    }

    public boolean currentUsersPasswordCanBeChanged() throws AuthenticationException, FindException {
        User user = JaasUtils.getCurrentUser();
        try {
            if (user == null) {
                throw new AuthenticationException(q[9]);
            }
        }
        catch (AuthenticationException authenticationException) {
            throw IdentityAdminImpl.a((Exception)((Object)authenticationException));
        }
        IdentityProvider identityProvider = this.m.getProvider(user.getProviderId());
        return identityProvider.getConfig().isWritable();
    }

    public void revokeCert(User user) throws UpdateException, ObjectNotFoundException {
        block7: {
            try {
                String string;
                InternalUser internalUser;
                UserManager userManager;
                block8: {
                    this.a.revokeUserCert(user);
                    IdentityProvider identityProvider = this.m.getProvider(user.getProviderId());
                    try {
                        if (identityProvider == null) {
                            throw new FindException(q[27]);
                        }
                    }
                    catch (FindException findException) {
                        throw IdentityAdminImpl.a((Exception)((Object)findException));
                    }
                    if (!IdentityProviderType.INTERNAL.equals(identityProvider.getConfig().type())) break block7;
                    String[] stringArray = q;
                    this.o.finest(stringArray[24]);
                    InternalUser internalUser2 = (InternalUser)user;
                    userManager = identityProvider.getUserManager();
                    internalUser = (InternalUser)userManager.findByLogin(internalUser2.getLogin());
                    string = internalUser2.getHashedPassword();
                    try {
                        if (string != null && !internalUser.getHashedPassword().equals(string)) break block8;
                    }
                    catch (FindException findException) {
                        throw IdentityAdminImpl.a((Exception)((Object)findException));
                    }
                    byte[] byArray = new byte[32];
                    this.a().nextBytes(byArray);
                    string = this.h.hashPassword(byArray);
                }
                internalUser.setHashedPassword(string);
                userManager.update((User)internalUser);
            }
            catch (FindException findException) {
                throw new UpdateException(q[73], (Throwable)findException);
            }
        }
    }

    public int revokeCertificates() throws UpdateException {
        String[] stringArray = q;
        this.o.info(stringArray[34]);
        int n2 = 0;
        try {
            SsgKeyEntry ssgKeyEntry = this.c.getCaInfo();
            try {
                if (ssgKeyEntry == null) {
                    throw new UpdateException(stringArray[81]);
                }
            }
            catch (FindException findException) {
                throw IdentityAdminImpl.a((Exception)((Object)findException));
            }
            X500Principal x500Principal = ssgKeyEntry.getCertificate().getSubjectX500Principal();
            List list = this.a.findAll();
            for (ClientCertManager.CertInfo certInfo : list) {
                stringArray = q;
                this.o.log(Level.FINE, stringArray[80], new String[]{certInfo.getLogin(), Goid.toString((Goid)certInfo.getProviderId()), certInfo.getUserId()});
                UserBean userBean = new UserBean();
                try {
                    userBean.setProviderId(certInfo.getProviderId());
                    userBean.setUniqueIdentifier(certInfo.getUserId());
                    userBean.setLogin(certInfo.getLogin());
                    if (this.a.revokeUserCertIfIssuerMatches((User)userBean, x500Principal)) {
                        ++n2;
                        this.o.log(Level.INFO, stringArray[52], new String[]{certInfo.getLogin(), Goid.toString((Goid)certInfo.getProviderId()), certInfo.getUserId()});
                        continue;
                    }
                }
                catch (FindException findException) {
                    throw IdentityAdminImpl.a((Exception)((Object)findException));
                }
                stringArray = q;
                this.o.log(Level.INFO, stringArray[37], new String[]{certInfo.getLogin(), Goid.toString((Goid)certInfo.getProviderId()), certInfo.getUserId()});
            }
            this.d.publishEvent((ApplicationEvent)new AuditRevokeAllUserCertificates((Object)this, n2));
        }
        catch (FindException findException) {
            throw new UpdateException(q[7], (Throwable)findException);
        }
        return n2;
    }

    public void recordNewUserCert(User user, Certificate certificate) throws UpdateException {
        this.a.recordNewUserCert(user, certificate, false);
    }

    public IdentityProviderPasswordPolicy getPasswordPolicyForIdentityProvider(Goid goid) throws FindException {
        return this.f.findByInternalIdentityProviderOid(goid);
    }

    public IdentityAdmin.AccountMinimums getAccountMinimums() {
        IdentityAdmin.AccountMinimums accountMinimums;
        String string;
        try {
            string = this.config.getBooleanProperty(q[33], false) ? q[20] : q[46];
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw IdentityAdminImpl.a(illegalArgumentException);
        }
        String string2 = string;
        Pair pair = (Pair)Functions.grepFirst(this.i, (Functions.Unary)new h(this, string2));
        try {
            accountMinimums = pair == null ? null : (IdentityAdmin.AccountMinimums)pair.left;
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw IdentityAdminImpl.a(illegalArgumentException);
        }
        return accountMinimums;
    }

    public Map<String, IdentityAdmin.AccountMinimums> getAccountMinimumsMap() {
        return (Map)Functions.reduce(this.i, new HashMap(), (Functions.Binary)new i(this));
    }

    public Map<String, IdentityProviderPasswordPolicy> getPasswordPolicyMinimums() {
        return (Map)Functions.reduce(this.i, new HashMap(), (Functions.Binary)new j(this));
    }

    public String getPasswordPolicyDescriptionForIdentityProvider() throws FindException {
        String string;
        User user = JaasUtils.getCurrentUser();
        try {
            if (user == null) {
                return null;
            }
        }
        catch (FindException findException) {
            throw IdentityAdminImpl.a((Exception)((Object)findException));
        }
        IdentityProviderPasswordPolicy identityProviderPasswordPolicy = this.f.findByInternalIdentityProviderOid(user.getProviderId());
        try {
            string = identityProviderPasswordPolicy == null ? null : identityProviderPasswordPolicy.getDescription();
        }
        catch (FindException findException) {
            throw IdentityAdminImpl.a((Exception)((Object)findException));
        }
        return string;
    }

    public String updatePasswordPolicy(Goid goid, IdentityProviderPasswordPolicy identityProviderPasswordPolicy) throws SaveException, UpdateException, ObjectNotFoundException {
        try {
            if (!goid.equals((Object)IdentityProviderConfigManager.INTERNALPROVIDER_SPECIAL_GOID)) {
                throw new SaveException(q[21] + String.valueOf(goid) + q[67]);
            }
        }
        catch (SaveException saveException) {
            throw IdentityAdminImpl.a((Exception)((Object)saveException));
        }
        identityProviderPasswordPolicy.setInternalIdentityProviderGoid(goid);
        this.f.update((PersistentEntity)identityProviderPasswordPolicy);
        return identityProviderPasswordPolicy.getId();
    }

    public void forceAdminUsersResetPassword(Goid goid) throws ObjectModelException {
        IdentityProvider identityProvider = this.m.getProvider(goid);
        if (identityProvider instanceof InternalIdentityProvider) {
            InternalIdentityProvider internalIdentityProvider = (InternalIdentityProvider)identityProvider;
            InternalUserManager internalUserManager = (InternalUserManager)internalIdentityProvider.getUserManager();
            EntityHeaderSet entityHeaderSet = internalUserManager.findAllHeaders();
            for (IdentityHeader identityHeader : entityHeaderSet) {
                InternalUser internalUser = (InternalUser)internalUserManager.findByPrimaryKey(identityHeader.getStrId());
                try {
                    if (!this.a((User)internalUser)) continue;
                    internalUser.setChangePassword(true);
                    internalUserManager.update((User)internalUser, null);
                }
                catch (ObjectModelException objectModelException) {
                    throw IdentityAdminImpl.a((Exception)((Object)objectModelException));
                }
            }
            this.d.publishEvent((ApplicationEvent)new AdministrativePasswordsResetEvent(this, internalIdentityProvider.getConfig().getName()));
        }
    }

    public void activateUser(User user) throws FindException, UpdateException {
        block9: {
            try {
                String[] stringArray;
                LogonInfo logonInfo = this.g.findByCompositeKey(user.getProviderId(), user.getLogin(), false);
                try {
                    if (logonInfo == null || logonInfo.getLastAttempted() <= 0L) break block9;
                }
                catch (FindException findException) {
                    throw IdentityAdminImpl.a((Exception)((Object)findException));
                }
                String string = null;
                logonInfo.setLastActivity(System.currentTimeMillis());
                logonInfo.resetFailCount(System.currentTimeMillis());
                if (logonInfo.getState().equals((Object)LogonInfo.State.INACTIVE)) {
                    stringArray = q;
                    string = stringArray[47];
                } else if (logonInfo.getState().equals((Object)LogonInfo.State.EXCEED_ATTEMPT)) {
                    stringArray = q;
                    string = stringArray[65];
                }
                logonInfo.setState(LogonInfo.State.ACTIVE);
                this.g.update(logonInfo);
                if (string != null) {
                    stringArray = q;
                    String string2 = stringArray[53] + user.getLogin() + stringArray[41] + string;
                    this.d.publishEvent((ApplicationEvent)new AdminEvent(this, string2, Level.WARNING){
                        static final long serialVersionUID = 4533959245112424696L;
                    });
                }
            }
            catch (FindException findException) {
                String[] stringArray = q;
                throw new FindException(stringArray[61] + user.getLogin() + "'", (Throwable)findException);
            }
            catch (UpdateException updateException) {
                throw new UpdateException(q[61] + user.getLogin() + "'", (Throwable)updateException);
            }
        }
    }

    public LogonInfo.State getLogonState(User user) throws FindException {
        try {
            LogonInfo logonInfo = this.g.findByCompositeKey(user.getProviderId(), user.getLogin(), false);
            if (logonInfo != null) {
                return logonInfo.getState();
            }
            return null;
        }
        catch (FindException findException) {
            throw new FindException(q[4] + user.getLogin() + "'", (Throwable)findException);
        }
    }

    private boolean a(User user) throws FindException {
        boolean bl2;
        block5: {
            block4: {
                Collection<Role> collection = this.b.getAssignedRoles(user, true, false);
                try {
                    try {
                        if (collection == null || collection.isEmpty()) break block4;
                    }
                    catch (FindException findException) {
                        throw IdentityAdminImpl.a((Exception)((Object)findException));
                    }
                    bl2 = true;
                    break block5;
                }
                catch (FindException findException) {
                    throw IdentityAdminImpl.a((Exception)((Object)findException));
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    private SecureRandom a() {
        return k;
    }

    public void testNtlmConfig(Map<String, String> map) throws InvalidIdProviderCfgException {
        NetlogonAdapter netlogonAdapter;
        HashMap<String, String> hashMap = new HashMap<String, String>(map);
        String[] stringArray = q;
        if (hashMap.containsKey(stringArray[36])) {
            try {
                netlogonAdapter = GoidUpgradeMapper.mapId((EntityType)EntityType.SECURE_PASSWORD, (String)((String)hashMap.get(stringArray[77])));
                String string = ServerVariables.getSecurePasswordByGoid((Audit)new LoggingAudit(this.o), (Goid)netlogonAdapter);
                hashMap.put(stringArray[29], string);
            }
            catch (FindException findException) {
                stringArray = q;
                throw new InvalidIdProviderCfgException(stringArray[74], (Throwable)findException);
            }
            catch (IllegalArgumentException illegalArgumentException) {
                stringArray = q;
                throw new InvalidIdProviderCfgException(stringArray[75], (Throwable)illegalArgumentException);
            }
        }
        try {
            netlogonAdapter = new NetlogonAdapter(hashMap);
            netlogonAdapter.testConnect();
        }
        catch (AuthenticationManagerException authenticationManagerException) {
            stringArray = q;
            this.o.log(Level.FINE, stringArray[49] + authenticationManagerException.getMessage());
            throw new InvalidIdProviderCfgException(stringArray[66], (Throwable)authenticationManagerException);
        }
    }

    public void testIdProviderConfig(IdentityProviderConfig identityProviderConfig, String string, char[] cArray) throws InvalidIdProviderCfgException {
        try {
            if (identityProviderConfig == null) {
                throw new NullPointerException(q[43]);
            }
        }
        catch (InvalidIdProviderCfgException invalidIdProviderCfgException) {
            throw IdentityAdminImpl.a((Exception)((Object)invalidIdProviderCfgException));
        }
        try {
            this.m.test(identityProviderConfig, string, cArray);
        }
        catch (InvalidIdProviderCfgException invalidIdProviderCfgException) {
            throw invalidIdProviderCfgException;
        }
        catch (Exception exception) {
            this.o.log(Level.INFO, q[6], exception);
            throw new InvalidIdProviderCfgException((Throwable)exception);
        }
    }

    public Set<IdentityHeader> getGroupHeaders(Goid goid, String string) throws FindException {
        return this.e(goid).getGroupHeaders(string);
    }

    public Set<IdentityHeader> getGroupHeadersForGroup(Goid goid, @NotNull String string) throws FindException {
        try {
            if (string == null) {
                IdentityAdminImpl.a(0);
            }
        }
        catch (FindException findException) {
            throw IdentityAdminImpl.a((Exception)((Object)findException));
        }
        return this.e(goid).getGroupHeadersForNestedGroup(string);
    }

    public void setGroupHeaders(Goid goid, String string, Set<IdentityHeader> set) throws FindException, UpdateException {
        this.e(goid).setGroupHeaders(string, set);
    }

    public Set<IdentityHeader> getUserHeaders(Goid goid, String string) throws FindException {
        return this.e(goid).getUserHeaders(string);
    }

    public void setUserHeaders(Goid goid, String string, Set<IdentityHeader> set) throws FindException, UpdateException {
        this.e(goid).setUserHeaders(string, set);
    }

    public LdapIdentityProviderConfig[] getLdapTemplates() throws FindException {
        return this.n.getTemplates();
    }

    public void setIdentityProviderConfigManager(IdentityProviderConfigManager identityProviderConfigManager) {
        this.l = identityProviderConfigManager;
    }

    public void setClientCertManager(ClientCertManager clientCertManager) {
        this.a = clientCertManager;
    }

    public void setIdentityProviderFactory(IdentityProviderFactory identityProviderFactory) {
        this.m = identityProviderFactory;
    }

    public void setLogonInfoManager(LogonInfoManager logonInfoManager) {
        this.g = logonInfoManager;
    }

    public void initDao() {
        this.b();
        this.c();
        this.d();
    }

    private void b() {
        try {
            if (this.m == null) {
                throw new IllegalArgumentException(q[18]);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw IdentityAdminImpl.a(illegalArgumentException);
        }
    }

    private void c() {
        try {
            if (this.l == null) {
                throw new IllegalArgumentException(q[0]);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw IdentityAdminImpl.a(illegalArgumentException);
        }
    }

    private void d() {
        try {
            if (this.a == null) {
                throw new IllegalArgumentException(q[10]);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw IdentityAdminImpl.a(illegalArgumentException);
        }
    }

    private IdentityProviderConfigManager e() {
        return this.l;
    }

    private UserManager d(Goid goid) throws FindException {
        IdentityProvider identityProvider = this.m.getProvider(goid);
        try {
            if (identityProvider == null) {
                throw new FindException(q[27]);
            }
        }
        catch (FindException findException) {
            throw IdentityAdminImpl.a((Exception)((Object)findException));
        }
        return identityProvider.getUserManager();
    }

    private GroupManager<?, ?> e(Goid goid) throws FindException {
        IdentityProvider identityProvider = this.m.getProvider(goid);
        try {
            if (identityProvider == null) {
                throw new FindException(q[27]);
            }
        }
        catch (FindException findException) {
            throw IdentityAdminImpl.a((Exception)((Object)findException));
        }
        return identityProvider.getGroupManager();
    }

    private InternalUser a(InternalUser internalUser) {
        InternalUser internalUser2 = new InternalUser();
        internalUser2.copyFrom((User)internalUser);
        internalUser2.setHashedPassword(null);
        internalUser2.changePasswordChangesHistory(null);
        internalUser2.setHttpDigest(null);
        internalUser2.setVersion(internalUser.getVersion());
        return internalUser2;
    }

    private void b(InternalUser internalUser) throws UpdateException {
        try {
            if (internalUser.getHashedPassword() != null) {
                throw new UpdateException(q[14]);
            }
        }
        catch (UpdateException updateException) {
            throw IdentityAdminImpl.a((Exception)((Object)updateException));
        }
        try {
            if (CollectionUtils.isNotEmpty((Collection)internalUser.getPasswordChangesHistory())) {
                throw new UpdateException(q[25]);
            }
        }
        catch (UpdateException updateException) {
            throw IdentityAdminImpl.a((Exception)((Object)updateException));
        }
        try {
            if (internalUser.getHttpDigest() != null) {
                throw new UpdateException(q[15]);
            }
        }
        catch (UpdateException updateException) {
            throw IdentityAdminImpl.a((Exception)((Object)updateException));
        }
    }

    private void a(InternalUser internalUser, InternalUser internalUser2) {
        internalUser.setHashedPassword(internalUser2.getHashedPassword());
        internalUser.setPasswordChangesHistory(internalUser2.getPasswordChangesHistory());
        internalUser.setHttpDigest(internalUser2.getHttpDigest());
    }

    /*
     * Unable to fully structure code
     */
    static {
        block12: {
            block11: {
                var5 = new String[83];
                var3_1 = 0;
                var2_2 = "\u0017:\u0019 L.S\u0007~\f<W1N\u001a;\u000en[(I\u00187\u001bnQ4\u0007\f;\r;Q5B\u001a-;,\u000e!JgA\u00170\u0018'V \u0007\u0017:\u0019 L.S\u0007~\f<W1N\u001a;\u000en^(U^:\u0019\"]3N\u00110R =?\u0012 W3\u0007\f;\b<Q\"Q\u001b~\b&]g`\f1\t>u&I\u001f9\u0019<\u000f:;\u0010+L\"C^\u0019\u000e!M7\u001d^\u001301\\\"W H\u0010~\u0015 ^(\u0007\u00181\u000en\u001f\u00137:\u0019 L.S\u0007~,<W1N\u001a;\u000en\u001b=7:\u0019 L.S\u0007~,<W1N\u001a;\u000enL\"T\n~\u001a/Q+B\u001a~\u001e+[&R\r;\\/VgB\u0006=\u0019>L.H\u0010~\u000b/KgS\u0016,\u00139V\u001b;,\u000e!JgU\u001b(\u0013%Q)@^=\u0019<L.A\u0017=\u001d:]4\u000e:;\u0010+L\"C^\u000b\u000f+J}\u0007\u0019=+\u000e<])S^+\u000f+JgF\r~\u0012!LgA\u0011+\u0012*#\u001d2\u0015+V3\u0007\u001d;\u000e:Q!N\u001d?\b+\u0018*F\u0010?\u001b+JgU\u001b/\t'J\"C\u0019=+\u000e<])S^+\u000f+JgF\r~\u0012!LgA\u0011+\u0012* =?\u0012 W3\u0007\f;\b<Q\"Q\u001b~\b&]g`\f1\t>u&I\u001f9\u0019<\u0002Yp5=?\u0012 W3\u0007\u00131\u0018'^>\u0007\u001b&\u0015=L.I\u0019~\t=]5T^.\u001d=K0H\f:\\;K.I\u0019~\b&Q4\u0007\u001f.\u0015`8=?\u0012 W3\u0007\u00131\u0018'^>\u0007\u001b&\u0015=L.I\u0019~\t=]5T^6\b:HgC\u00179\u0019=LgR\r7\u0012)\u00183O\u0017-\\/H.\t&\u0010;\u000b\rT\"F\f\n\u00196L\u0017F\r-\u000b!J#\u0007\u0013+\u000f:\u0018%B^-\t>H+N\u001b:R#+.\u0018/L\"C^.\u001d=K0H\f:\\(W5\u000770\b+J)F\u0012~)=]5\u0007%\u0017:\u0019 L.S\u0007~\f<W1N\u001a;\u000en^&D\n1\u000e7\u0018.T^,\u0019?M.U\u001b:\u0002^\u0005\u0007.\u001d5c|\u0014t5=?\u0012 W3\u0007\u000b.\u0018/L\"\u0007\u000e?\u000f=O(U\u001a~\f!T.D\u0007~\u001a!JgN\u001a;\u0012:Q3^^.\u000e!N.C\u001b,\\\u0015#7:\u0019 L.S\u0007\u000e\u000e!N.C\u001b,\\-W2K\u001a~\u0012!LgE\u001b~\u001a!M)C\u001a:;\u0010+L\"C^\u00178\u001eJ(Q\u0017:\u0019<{(I\u00187\u001bt\u0018,=;\u000e:\u00185B\b1\u0017+\\g\n^7\u00128Y+N\u001a?\b'V \u0007\u000b-\u0019<\u001f4\u0007\u000e?\u000f=O(U\u001ap==?\u0012 W3\u0007\u00131\u0018'^>\u0007\u001b&\u0015=L.I\u0019~\t=]5T^.\u001d=K0H\f:\\&Q4S\u0011,\u0005nM4N\u00109\\:P.T^?\f'\u0016>?,\u001b;U\"I\n~\u001a!Jgg01\b\u0000M+K^.\u001d<Y*B\n;\u000en\u001fbTY~\u0013(\u0018bTP{\u000fnU2T\n~\u0012!LgE\u001b~\u0012;T+#7:\u0019 L.S\u0007\u000e\u000e!N.C\u001b,\\-W2K\u001a~\u0012!LgE\u001b~\u001a!M)C\r-?\n+\\g`\f1\t>\u0002g\u0010\r;\u000e8Q$BP.\u001d=K0H\f:2*6\u0015=\u0018(E\u0014;\u001f:\u0018$F\u00100\u0013:\u0018%B^8\u0013;V#\u0007V7\bnV(\u0007\u00121\u0012)]5\u0007\u001b&\u0015=Lx\u000eP\u001c+-\u0019<KgT\u00161\t\"\\gU\u001b/\t'J\"\u0007\u000b.\u0018/L\"\t\u000f^:\u0013+KgI\u0011*\\+@.T\n\u0017\r;\u001f;J.S\u0007p\f-Q#T\rp\u0019 Y%K\u001b:\u001f,;\n!S.I\u0019~\u001d\"TgR\r;\u000en[\"U\n7\u001a'[&S\u001b-R\u0017\f1\u0010+u&I\u001f9\u0019<\u0018.T^,\u0019?M.U\u001b:\u0013\r;\u000e8Q$BP.\u001d=K0H\f:3'\\3=;\u000e:Q!N\u001d?\b+\u0018)H\n~\u000e+N(L\u001b:\\(W5\u0007\u000b-\u0019<\u0018`\u0000\u0005n\u0001i\u001fg|\u0005o\u0001aCuZ#p\u001f=?\u0012 W3\u0007\f;\b<Q\"Q\u001b~\b&]gr\r;\u000e\u0003Y)F\u0019;\u000e.*6\u0019n[2U\f;\u0012:T>\u0007\u00121\u001b)]#\n\u00170\\;K\"U^=\u001d V(S^<\u0019n\\\"K\u001b*\u0019*\u0007\u0019,\u0013;H\u000eC\u0005Y~\u0015=\u0018\u000f^:\u0013+KgI\u0011*\\+@.T\n4\u00101\u0012cV2K\u0012~\u0015*])S\u0017*\u0005\u001eJ(Q\u0017:\u0019<{(I\u00187\u001bnQ4\u0007\f;\r;Q5B\u001a~\u001a!JgS\u001b-\bO*6\u0019nV\"P^.\u001d=K0H\f:\\'KgS\u0016;\\=Y*B^?\u000fnL/B^1\u0010*\u0018(I\u001bpv\u001eT\"F\r;\\+V3B\f~\u001dn\\.A\u0018;\u000e+V3\u0007\u000e?\u000f=O(U\u001ap*=?\u0012 W3\u0007\u001d6\u001d _\"\u0007\u00101\u0012nQ)S\u001b,\u0012/TgR\r;\u000e=\u00187F\r-\u000b!J#\t\u0004-\n5\t\t\u001f=\b'N&S\u001b:$7:\u0019 L.S\u0007~\f<W1N\u001a;\u000enV(S^8\u0013;V#\u0007\u00181\u000enQ#\u0007Y%8?\u0015\"]#\u0007\n1\\-W)I\u001b=\bnL(\u00070;\b\"W H\u0010~\u000f+J1N\u001d;\u00137:\u0019 L.S\u0007~,<W1N\u001a;\u000en\u001b\u000e+.\u0018/L\"C^\u000b\u000f+J}\u0007/,;\n!S\"C^=\u0019<L.A\u0017=\u001d:]gA\u0011,\\;K\"U^y[5\b:\u0000Y~'5\t:\b\u0005l\u0001\u0013\u0016\u0006+-\u0019<\u0018`\u001a87\u0012*}?D\u001b.\b'W)\u0007\u00170\\=Y1B9,\u0013;H\u001a+.\u0018/L\"C^\u00178\u001eJ(Q\u0017:\u0019<{(I\u00187\u001bt\u0018\u0002Yp\u001a87\u0012*}?D\u001b.\b'W)\u0007\u00170\\=Y1B9,\u0013;H\u0015;&\u001f+H3N\u00110\\'VgT\u001f(\u0019\u001bK\"U\u001f=?\u0012 W3\u0007\f;\b<Q\"Q\u001b~\b&]gr\r;\u000e\u0003Y)F\u0019;\u000e\u0019-?\n'V \u00077\u001a,<W1N\u001a;\u000e\rW)A\u00179Fn\u001301\\\"W H\u0010~\u0015 ^(\u0007\u00181\u000en\u001f\f-?\n+\\gr\r;\u000et\u0018?70\n/T.C.?\u000f=O(U\u001a\u001b\u0004-]7S\u00171\u0012n[&R\u00196\bnO/B\u0010~\t>\\&S\u00170\u001bnY)\u0007\u001b&\u0015=L.I\u0019~\t=]5\t\u000f+.\u0018/L\"C^\u0019\u000e!M7\u001d^\b\u000b0\u0010![,B\u001a\u001a70\n/T.C^\u0010(\u0002ugD\u00110\u001a'_2U\u001f*\u0015!V\u0002#p2*6\u0015=\u0018(E\u0014;\u001f:\u0018$F\u00100\u0013:\u0018%B^8\u0013;V#\u0007V7\bnV(\u0007\u00121\u0012)]5\u0007\u001b&\u0015=Lx\u000eP,\u001d1\u0011aTpS\u001b=\u0014aK\"U\b;\u000eaQ#B\u0010*\u0015:Ahn\u001a;\u0012:Q3^?:\u0011'V\u000eJ\u000e2(\u001f.\f\"Q$F\n7\u0013 }1B\u0010*,;Z+N\r6\u0019<\u0018.T^?\u0010<]&C\u0007~\u000f+L\u00149,\u0013;HgC\u0011;\u000fnV(S^;\u0004'K3\u0002^\u0005\u001f\u001b,\u000e!JgU\u001b-\u0019:L.I\u0019~\t=]5\u0000\r~\f/K4P\u0011,\u0018\u0013.?\u000f=O(U\u001a~\u0015=\u0018.I\b?\u0010'\\\u0013.?\u000f=O(U\u001a~\u0015=\u0018.I\b?\u0010'\\$7:\u0019 L.S\u0007~\f<W1N\u001a;\u000enV(S^8\u0013;V#\u0007\u00181\u000enQ#\u0007Y\u0013\r;\u000e8Q$BP.\u001d=K0H\f:3'\\\u0006^\u000b\u000f+Jg\u0017\u0019;\b\tJ(R\u000e\u0016\u0019/\\\"U\r\u0018\u0013<\u007f5H\u000b.0,;\n!S.I\u0019~\u001f+J3N\u00187\u001f/L\"\u0007\u00181\u000enM4B\f~[iCwZYy\\\u0015CvZQ%N3ei";
                var4_3 = "\u0017:\u0019 L.S\u0007~\f<W1N\u001a;\u000en[(I\u00187\u001bnQ4\u0007\f;\r;Q5B\u001a-;,\u000e!JgA\u00170\u0018'V \u0007\u0017:\u0019 L.S\u0007~\f<W1N\u001a;\u000en^(U^:\u0019\"]3N\u00110R =?\u0012 W3\u0007\f;\b<Q\"Q\u001b~\b&]g`\f1\t>u&I\u001f9\u0019<\u000f:;\u0010+L\"C^\u0019\u000e!M7\u001d^\u001301\\\"W H\u0010~\u0015 ^(\u0007\u00181\u000en\u001f\u00137:\u0019 L.S\u0007~,<W1N\u001a;\u000en\u001b=7:\u0019 L.S\u0007~,<W1N\u001a;\u000enL\"T\n~\u001a/Q+B\u001a~\u001e+[&R\r;\\/VgB\u0006=\u0019>L.H\u0010~\u000b/KgS\u0016,\u00139V\u001b;,\u000e!JgU\u001b(\u0013%Q)@^=\u0019<L.A\u0017=\u001d:]4\u000e:;\u0010+L\"C^\u000b\u000f+J}\u0007\u0019=+\u000e<])S^+\u000f+JgF\r~\u0012!LgA\u0011+\u0012*#\u001d2\u0015+V3\u0007\u001d;\u000e:Q!N\u001d?\b+\u0018*F\u0010?\u001b+JgU\u001b/\t'J\"C\u0019=+\u000e<])S^+\u000f+JgF\r~\u0012!LgA\u0011+\u0012* =?\u0012 W3\u0007\f;\b<Q\"Q\u001b~\b&]g`\f1\t>u&I\u001f9\u0019<\u0002Yp5=?\u0012 W3\u0007\u00131\u0018'^>\u0007\u001b&\u0015=L.I\u0019~\t=]5T^.\u001d=K0H\f:\\;K.I\u0019~\b&Q4\u0007\u001f.\u0015`8=?\u0012 W3\u0007\u00131\u0018'^>\u0007\u001b&\u0015=L.I\u0019~\t=]5T^6\b:HgC\u00179\u0019=LgR\r7\u0012)\u00183O\u0017-\\/H.\t&\u0010;\u000b\rT\"F\f\n\u00196L\u0017F\r-\u000b!J#\u0007\u0013+\u000f:\u0018%B^-\t>H+N\u001b:R#+.\u0018/L\"C^.\u001d=K0H\f:\\(W5\u000770\b+J)F\u0012~)=]5\u0007%\u0017:\u0019 L.S\u0007~\f<W1N\u001a;\u000en^&D\n1\u000e7\u0018.T^,\u0019?M.U\u001b:\u0002^\u0005\u0007.\u001d5c|\u0014t5=?\u0012 W3\u0007\u000b.\u0018/L\"\u0007\u000e?\u000f=O(U\u001a~\f!T.D\u0007~\u001a!JgN\u001a;\u0012:Q3^^.\u000e!N.C\u001b,\\\u0015#7:\u0019 L.S\u0007\u000e\u000e!N.C\u001b,\\-W2K\u001a~\u0012!LgE\u001b~\u001a!M)C\u001a:;\u0010+L\"C^\u00178\u001eJ(Q\u0017:\u0019<{(I\u00187\u001bt\u0018,=;\u000e:\u00185B\b1\u0017+\\g\n^7\u00128Y+N\u001a?\b'V \u0007\u000b-\u0019<\u001f4\u0007\u000e?\u000f=O(U\u001ap==?\u0012 W3\u0007\u00131\u0018'^>\u0007\u001b&\u0015=L.I\u0019~\t=]5T^.\u001d=K0H\f:\\&Q4S\u0011,\u0005nM4N\u00109\\:P.T^?\f'\u0016>?,\u001b;U\"I\n~\u001a!Jgg01\b\u0000M+K^.\u001d<Y*B\n;\u000en\u001fbTY~\u0013(\u0018bTP{\u000fnU2T\n~\u0012!LgE\u001b~\u0012;T+#7:\u0019 L.S\u0007\u000e\u000e!N.C\u001b,\\-W2K\u001a~\u0012!LgE\u001b~\u001a!M)C\r-?\n+\\g`\f1\t>\u0002g\u0010\r;\u000e8Q$BP.\u001d=K0H\f:2*6\u0015=\u0018(E\u0014;\u001f:\u0018$F\u00100\u0013:\u0018%B^8\u0013;V#\u0007V7\bnV(\u0007\u00121\u0012)]5\u0007\u001b&\u0015=Lx\u000eP\u001c+-\u0019<KgT\u00161\t\"\\gU\u001b/\t'J\"\u0007\u000b.\u0018/L\"\t\u000f^:\u0013+KgI\u0011*\\+@.T\n\u0017\r;\u001f;J.S\u0007p\f-Q#T\rp\u0019 Y%K\u001b:\u001f,;\n!S.I\u0019~\u001d\"TgR\r;\u000en[\"U\n7\u001a'[&S\u001b-R\u0017\f1\u0010+u&I\u001f9\u0019<\u0018.T^,\u0019?M.U\u001b:\u0013\r;\u000e8Q$BP.\u001d=K0H\f:3'\\3=;\u000e:Q!N\u001d?\b+\u0018)H\n~\u000e+N(L\u001b:\\(W5\u0007\u000b-\u0019<\u0018`\u0000\u0005n\u0001i\u001fg|\u0005o\u0001aCuZ#p\u001f=?\u0012 W3\u0007\f;\b<Q\"Q\u001b~\b&]gr\r;\u000e\u0003Y)F\u0019;\u000e.*6\u0019n[2U\f;\u0012:T>\u0007\u00121\u001b)]#\n\u00170\\;K\"U^=\u001d V(S^<\u0019n\\\"K\u001b*\u0019*\u0007\u0019,\u0013;H\u000eC\u0005Y~\u0015=\u0018\u000f^:\u0013+KgI\u0011*\\+@.T\n4\u00101\u0012cV2K\u0012~\u0015*])S\u0017*\u0005\u001eJ(Q\u0017:\u0019<{(I\u00187\u001bnQ4\u0007\f;\r;Q5B\u001a~\u001a!JgS\u001b-\bO*6\u0019nV\"P^.\u001d=K0H\f:\\'KgS\u0016;\\=Y*B^?\u000fnL/B^1\u0010*\u0018(I\u001bpv\u001eT\"F\r;\\+V3B\f~\u001dn\\.A\u0018;\u000e+V3\u0007\u000e?\u000f=O(U\u001ap*=?\u0012 W3\u0007\u001d6\u001d _\"\u0007\u00101\u0012nQ)S\u001b,\u0012/TgR\r;\u000e=\u00187F\r-\u000b!J#\t\u0004-\n5\t\t\u001f=\b'N&S\u001b:$7:\u0019 L.S\u0007~\f<W1N\u001a;\u000enV(S^8\u0013;V#\u0007\u00181\u000enQ#\u0007Y%8?\u0015\"]#\u0007\n1\\-W)I\u001b=\bnL(\u00070;\b\"W H\u0010~\u000f+J1N\u001d;\u00137:\u0019 L.S\u0007~,<W1N\u001a;\u000en\u001b\u000e+.\u0018/L\"C^\u000b\u000f+J}\u0007/,;\n!S\"C^=\u0019<L.A\u0017=\u001d:]gA\u0011,\\;K\"U^y[5\b:\u0000Y~'5\t:\b\u0005l\u0001\u0013\u0016\u0006+-\u0019<\u0018`\u001a87\u0012*}?D\u001b.\b'W)\u0007\u00170\\=Y1B9,\u0013;H\u001a+.\u0018/L\"C^\u00178\u001eJ(Q\u0017:\u0019<{(I\u00187\u001bt\u0018\u0002Yp\u001a87\u0012*}?D\u001b.\b'W)\u0007\u00170\\=Y1B9,\u0013;H\u0015;&\u001f+H3N\u00110\\'VgT\u001f(\u0019\u001bK\"U\u001f=?\u0012 W3\u0007\f;\b<Q\"Q\u001b~\b&]gr\r;\u000e\u0003Y)F\u0019;\u000e\u0019-?\n'V \u00077\u001a,<W1N\u001a;\u000e\rW)A\u00179Fn\u001301\\\"W H\u0010~\u0015 ^(\u0007\u00181\u000en\u001f\f-?\n+\\gr\r;\u000et\u0018?70\n/T.C.?\u000f=O(U\u001a\u001b\u0004-]7S\u00171\u0012n[&R\u00196\bnO/B\u0010~\t>\\&S\u00170\u001bnY)\u0007\u001b&\u0015=L.I\u0019~\t=]5\t\u000f+.\u0018/L\"C^\u0019\u000e!M7\u001d^\b\u000b0\u0010![,B\u001a\u001a70\n/T.C^\u0010(\u0002ugD\u00110\u001a'_2U\u001f*\u0015!V\u0002#p2*6\u0015=\u0018(E\u0014;\u001f:\u0018$F\u00100\u0013:\u0018%B^8\u0013;V#\u0007V7\bnV(\u0007\u00121\u0012)]5\u0007\u001b&\u0015=Lx\u000eP,\u001d1\u0011aTpS\u001b=\u0014aK\"U\b;\u000eaQ#B\u0010*\u0015:Ahn\u001a;\u0012:Q3^?:\u0011'V\u000eJ\u000e2(\u001f.\f\"Q$F\n7\u0013 }1B\u0010*,;Z+N\r6\u0019<\u0018.T^?\u0010<]&C\u0007~\u000f+L\u00149,\u0013;HgC\u0011;\u000fnV(S^;\u0004'K3\u0002^\u0005\u001f\u001b,\u000e!JgU\u001b-\u0019:L.I\u0019~\t=]5\u0000\r~\f/K4P\u0011,\u0018\u0013.?\u000f=O(U\u001a~\u0015=\u0018.I\b?\u0010'\\\u0013.?\u000f=O(U\u001a~\u0015=\u0018.I\b?\u0010'\\$7:\u0019 L.S\u0007~\f<W1N\u001a;\u000enV(S^8\u0013;V#\u0007\u00181\u000enQ#\u0007Y\u0013\r;\u000e8Q$BP.\u001d=K0H\f:3'\\\u0006^\u000b\u000f+Jg\u0017\u0019;\b\tJ(R\u000e\u0016\u0019/\\\"U\r\u0018\u0013<\u007f5H\u000b.0,;\n!S.I\u0019~\u001f+J3N\u00187\u001f/L\"\u0007\u00181\u000enM4B\f~[iCwZYy\\\u0015CvZQ%N3ei".length();
                var1_4 = 36;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 43;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block11;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = IdentityAdminImpl.a(v0, IdentityAdminImpl.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "MK~J!Q>mOx[hV\"zFcL!C..G\u007f\u001e&X#.McP.^0{\\iZf\u0015KVo[8C>a@,W&\u0017$oXik;R%";
                    var4_3 = "MK~J!Q>mOx[hV\"zFcL!C..G\u007f\u001e&X#.McP.^0{\\iZf\u0015KVo[8C>a@,W&\u0017$oXik;R%".length();
                    var1_4 = 40;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 91;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block11;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = IdentityAdminImpl.a(v0, IdentityAdminImpl.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block12;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        IdentityAdminImpl.q = var5;
        try {
            v5 = IdentityAdminImpl.class.desiredAssertionStatus() == false;
        }
        catch (IllegalArgumentException v6) {
            throw IdentityAdminImpl.a(v6);
        }
        IdentityAdminImpl.p = v5;
        IdentityAdminImpl.j = Goid.toString((Goid)PersistentEntity.DEFAULT_GOID);
        IdentityAdminImpl.k = new SecureRandom();
    }

    private static /* synthetic */ void a(int n2) {
        String[] stringArray = q;
        throw new IllegalArgumentException(String.format(stringArray[26], stringArray[40], stringArray[69], stringArray[79]));
    }

    private static Exception a(Exception exception) {
        return exception;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0xC);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 85;
                    case 1 -> 117;
                    case 2 -> 87;
                    case 3 -> 101;
                    case 4 -> 19;
                    case 5 -> 108;
                    default -> 12;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

