package defpackage;

import j$.util.concurrent.ConcurrentHashMap;
import java.security.GeneralSecurityException;
import java.util.logging.Logger;

/* renamed from: ᵭˌˏ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C4114 {

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public static final Logger f15366 = Logger.getLogger(C4114.class.getName());

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public static final C4114 f15367;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public ConcurrentHashMap f15368;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public ConcurrentHashMap f15369;

    static {
        C4114 c4114 = new C4114();
        c4114.f15368 = new ConcurrentHashMap();
        c4114.f15369 = new ConcurrentHashMap();
        f15367 = c4114;
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final synchronized void m9007(C5370 c5370, int i) {
        if (!(i != 1 ? AbstractC2990.m7308(i) : AbstractC2990.m7330(i))) {
            throw new GeneralSecurityException("Cannot register key manager: FIPS compatibility insufficient");
        }
        m9008(c5370);
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final synchronized void m9008(C5370 c5370) {
        try {
            String str = c5370.f20137;
            if (this.f15369.containsKey(str) && !((Boolean) this.f15369.get(str)).booleanValue()) {
                throw new GeneralSecurityException("New keys are already disallowed for key type ".concat(str));
            }
            if (((C5370) this.f15368.get(str)) != null && !C5370.class.equals(C5370.class)) {
                f15366.warning("Attempted overwrite of a registered key manager for key type ".concat(str));
                throw new GeneralSecurityException("typeUrl (" + str + ") is already registered with " + C5370.class.getName() + ", cannot be re-registered with " + C5370.class.getName());
            }
            this.f15368.putIfAbsent(str, c5370);
            this.f15369.put(str, Boolean.TRUE);
        } catch (Throwable th) {
            throw th;
        }
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C5370 m9009(Class cls, String str) throws GeneralSecurityException {
        C5370 c5370M9010 = m9010(str);
        if (c5370M9010.f20138.equals(cls)) {
            return c5370M9010;
        }
        StringBuilder sb = new StringBuilder("Primitive type ");
        sb.append(cls.getName());
        sb.append(" not supported by key manager of type ");
        sb.append(C5370.class);
        Class cls2 = c5370M9010.f20138;
        sb.append(", which only supports: ");
        sb.append(cls2);
        throw new GeneralSecurityException(sb.toString());
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final synchronized C5370 m9010(String str) {
        if (!this.f15368.containsKey(str)) {
            throw new GeneralSecurityException("No key manager found for key type " + str + ", see https://developers.google.com/tink/faq/registration_errors");
        }
        return (C5370) this.f15368.get(str);
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final synchronized void m9011(C5370 c5370) {
        m9007(c5370, 1);
    }
}
