package com.google.android.gms.internal.pal;

import java.security.GeneralSecurityException;
import java.util.Collections;
import java.util.Map;
import java.util.Set;

/* JADX INFO: loaded from: classes2.dex */
public final class g7 implements i7 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f20934a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ Object f20935b;

    public /* synthetic */ g7(b8 b8Var, int i10) {
        this.f20934a = i10;
        this.f20935b = b8Var;
    }

    @Override // com.google.android.gms.internal.pal.i7
    public final m5 zza(Class cls) throws GeneralSecurityException {
        int i10 = this.f20934a;
        Object obj = this.f20935b;
        switch (i10) {
            case 0:
                m5 m5Var = (m5) obj;
                if (((Class) m5Var.f21082c).equals(cls)) {
                    return m5Var;
                }
                throw new InternalError("This should never be called, as we always first check supportedPrimitives.");
            default:
                try {
                    return new m5((k.e) obj, cls);
                } catch (IllegalArgumentException e10) {
                    throw new GeneralSecurityException("Primitive type not supported", e10);
                }
        }
    }

    @Override // com.google.android.gms.internal.pal.i7
    public final m5 zzb() {
        int i10 = this.f20934a;
        Object obj = this.f20935b;
        switch (i10) {
            case 0:
                return (m5) obj;
            default:
                k.e eVar = (k.e) obj;
                return new m5(eVar, eVar.f28821c);
        }
    }

    @Override // com.google.android.gms.internal.pal.i7
    public final Class zzc() {
        int i10 = this.f20934a;
        Object obj = this.f20935b;
        switch (i10) {
            case 0:
                return ((m5) obj).getClass();
            default:
                return ((k.e) obj).getClass();
        }
    }

    @Override // com.google.android.gms.internal.pal.i7
    public final Class zzd() {
        return null;
    }

    @Override // com.google.android.gms.internal.pal.i7
    public final Set zze() {
        int i10 = this.f20934a;
        Object obj = this.f20935b;
        switch (i10) {
            case 0:
                return Collections.singleton((Class) ((m5) obj).f21082c);
            default:
                return ((Map) ((k.e) obj).f28820b).keySet();
        }
    }
}
