package defpackage;

import com.hierynomus.spnego.SpnegoException;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.ArrayList;

/* JADX INFO: renamed from: ᵩᵺᵪ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractC3852 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public String f14715;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public int f14716;

    public AbstractC3852(int i, String str) {
        this.f14716 = i;
        this.f14715 = str;
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public void m8564(AbstractC1256 abstractC1256) throws SpnegoException {
        int i = this.f14716;
        String str = this.f14715;
        if (abstractC1256 instanceof C3149) {
            C3149 c3149 = (C3149) abstractC1256;
            if (c3149.f5297.f8164 == i) {
                AbstractC1256 abstractC1256M7257 = c3149.m7257();
                if (!(abstractC1256M7257 instanceof C3781)) {
                    throw new SpnegoException("Expected a " + str + " (SEQUENCE), not: " + abstractC1256M7257);
                }
                for (AbstractC1256 abstractC12562 : (C3781) abstractC1256M7257) {
                    if (!(abstractC12562 instanceof C3149)) {
                        throw new SpnegoException("Expected an ASN.1 TaggedObject as " + str + " contents, not: " + abstractC12562);
                    }
                    mo1180((C3149) abstractC12562);
                }
                return;
            }
        }
        throw new SpnegoException("Expected to find the " + str + " (CHOICE [" + i + "]) header, not: " + abstractC1256);
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public abstract void mo1180(C3149 c3149);

    /* JADX INFO: renamed from: ᵨᵣ */
    public void mo8297(AbstractC0692 abstractC0692, AbstractC1256 abstractC1256) throws IOException {
        C3149 c3149 = new C3149(AbstractC2059.m5484(EnumC0407.f2286, this.f14716).m5485(EnumC2959.f11376), abstractC1256, true);
        ArrayList arrayList = new ArrayList();
        arrayList.add(AbstractC1895.f7511);
        arrayList.add(c3149);
        C3149 c31492 = new C3149(AbstractC2059.m5484(EnumC0407.f2284, 0), (AbstractC1256) new C3781(arrayList), false);
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        C1600 c1600 = new C1600(new C3664(16), byteArrayOutputStream);
        try {
            c1600.m4449(c31492);
            c1600.close();
            byte[] byteArray = byteArrayOutputStream.toByteArray();
            abstractC0692.mo2472(byteArray.length, byteArray);
        } catch (Throwable th) {
            try {
                throw th;
            } catch (Throwable th2) {
                try {
                    c1600.close();
                } catch (Throwable th3) {
                    th.addSuppressed(th3);
                }
                throw th2;
            }
        }
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public abstract byte[] mo4103();

    /* JADX INFO: renamed from: ᵷᵺʾᵖ */
    public abstract void mo4104(byte[] bArr, int i, int i2);
}
