package defpackage;

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

/* renamed from: ᵗᵷˆ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public abstract class AbstractC2482 {

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

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public String f9702;

    public AbstractC2482(int i, String str) {
        this.f9701 = i;
        this.f9702 = str;
    }

    /* renamed from: ˇʼʤˎ */
    public void mo1624(AbstractC4362 abstractC4362, AbstractC2943 abstractC2943) throws IOException {
        C3647 c3647 = new C3647(AbstractC1728.m4925(EnumC4215.f15802, this.f9701).m4926(EnumC4278.f16052), abstractC2943, true);
        ArrayList arrayList = new ArrayList();
        arrayList.add(AbstractC1869.f7569);
        arrayList.add(c3647);
        C3647 c36472 = new C3647(AbstractC1728.m4925(EnumC4215.f15803, 0), (AbstractC2943) new C5443(arrayList), false);
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        C3692 c3692 = new C3692(new ˊᵻ(16), byteArrayOutputStream);
        try {
            c3692.m8285(c36472);
            c3692.close();
            byte[] byteArray = byteArrayOutputStream.toByteArray();
            abstractC4362.mo5106(byteArray.length, byteArray);
        } catch (Throwable th) {
            try {
                throw th;
            } catch (Throwable th2) {
                try {
                    c3692.close();
                } catch (Throwable th3) {
                    th.addSuppressed(th3);
                }
                throw th2;
            }
        }
    }

    /* renamed from: ˏᵙ */
    public abstract void mo1626(C3647 c3647);

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public abstract byte[] mo6322();

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public void m6323(AbstractC2943 abstractC2943) throws IOException, SpnegoException {
        int i = this.f9701;
        String str = this.f9702;
        if (abstractC2943 instanceof C3647) {
            C3647 c3647 = (C3647) abstractC2943;
            if (c3647.f11406.f6877 == i) {
                AbstractC2943 abstractC2943M8239 = c3647.m8239();
                if (!(abstractC2943M8239 instanceof C5443)) {
                    throw new SpnegoException("Expected a " + str + " (SEQUENCE), not: " + abstractC2943M8239);
                }
                Iterator it = ((C5443) abstractC2943M8239).iterator();
                while (it.hasNext()) {
                    AbstractC2943 abstractC29432 = (AbstractC2943) it.next();
                    if (!(abstractC29432 instanceof C3647)) {
                        throw new SpnegoException("Expected an ASN.1 TaggedObject as " + str + " contents, not: " + abstractC29432);
                    }
                    mo1626((C3647) abstractC29432);
                }
                return;
            }
        }
        throw new SpnegoException("Expected to find the " + str + " (CHOICE [" + i + "]) header, not: " + abstractC2943);
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public abstract void mo6324(byte[] bArr, int i, int i2);
}
