/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.policy.assertion.ext.SecurityContext
 */
package com.l7tech.server.policy.assertion;

import com.l7tech.policy.assertion.ext.SecurityContext;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.policy.assertion.ServerCustomAssertionHolder;
import com.l7tech.server.policy.assertion.l;
import java.security.AccessController;
import java.security.GeneralSecurityException;
import javax.security.auth.Subject;

class j
implements SecurityContext {
    final ServerCustomAssertionHolder val$this$0;
    final PolicyEnforcementContext val$policyContext;
    final l this$1;
    private static final String a = j.a(123, j.a(" dZ_Yyn\u0002p@YSc:\nfUES-'\r%@YS-<\u0006vD^X~+"));

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    j(l l2, ServerCustomAssertionHolder serverCustomAssertionHolder, PolicyEnforcementContext policyEnforcementContext) {
        this.this$1 = l2;
        this.val$this$0 = serverCustomAssertionHolder;
        this.val$policyContext = policyEnforcementContext;
    }

    public Subject getSubject() {
        return Subject.getSubject(AccessController.getContext());
    }

    public boolean isAuthenticated() {
        return this.val$policyContext.getDefaultAuthenticationContext().isAuthenticated();
    }

    public void setAuthenticated() throws GeneralSecurityException {
        try {
            if (this.this$1.c) {
                throw new GeneralSecurityException(a);
            }
        }
        catch (GeneralSecurityException generalSecurityException) {
            throw j.a(generalSecurityException);
        }
    }

    private static GeneralSecurityException a(GeneralSecurityException generalSecurityException) {
        return generalSecurityException;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x35);
        }
        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 -> 24;
                    case 1 -> 126;
                    case 2 -> 79;
                    case 3 -> 74;
                    case 4 -> 77;
                    case 5 -> 118;
                    default -> 53;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

