package o; import java.io.ByteArrayInputStream; import java.io.IOException; import java.security.cert.CRLSelector; import java.security.cert.CertSelector; import java.security.cert.CertStoreException; import java.security.cert.CertStoreSpi; import java.security.cert.Certificate; import java.security.cert.CertificateFactory; import java.security.cert.X509CertSelector; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import java.util.Set; /* renamed from: o.grw, reason: case insensitive filesystem */ /* loaded from: classes6.dex */ public class C15495grw extends CertStoreSpi { private static int a = 0; private static int e = 1; private gqW c; @Override // java.security.cert.CertStoreSpi public Collection engineGetCertificates(CertSelector certSelector) throws CertStoreException { gpG gpg; int i = 2 % 2; int i2 = e + 7; a = i2 % 128; int i3 = i2 % 2; if (!(certSelector instanceof X509CertSelector)) { throw new CertStoreException("selector is not a X509CertSelector"); } X509CertSelector x509CertSelector = (X509CertSelector) certSelector; HashSet hashSet = new HashSet(); Set a2 = a(); a2.addAll(d()); a2.addAll(c()); Iterator it = a2.iterator(); try { CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509", "SC"); while (!(!it.hasNext())) { byte[] bArr = (byte[]) it.next(); if (bArr != null) { int i4 = e + 59; a = i4 % 128; Object obj = null; if (i4 % 2 != 0) { int length = bArr.length; obj.hashCode(); throw null; } if (bArr.length != 0) { ArrayList arrayList = new ArrayList(); arrayList.add(bArr); try { AbstractC15346gnv b = new C15348gnx(bArr).b(); if (b != null) { int i5 = a + 123; e = i5 % 128; int i6 = i5 % 2; if (!(b instanceof AbstractC15317gnH)) { StringBuilder sb = new StringBuilder("illegal object in getInstance: "); sb.append(b.getClass().getName()); throw new IllegalArgumentException(sb.toString()); } gpg = new gpG((AbstractC15317gnH) b); int i7 = e + 87; a = i7 % 128; int i8 = i7 % 2; } else { gpg = (gpG) b; } arrayList.clear(); if (gpg.d != null) { int i9 = e + 125; a = i9 % 128; if (i9 % 2 != 0) { arrayList.add(gpg.d.l()); obj.hashCode(); throw null; } arrayList.add(gpg.d.l()); } if (gpg.e != null) { int i10 = a + 87; e = i10 % 128; int i11 = i10 % 2; arrayList.add(gpg.e.l()); } } catch (IOException | IllegalArgumentException unused) { } Iterator it2 = arrayList.iterator(); while (it2.hasNext()) { try { Certificate generateCertificate = certificateFactory.generateCertificate(new ByteArrayInputStream((byte[]) it2.next())); if (x509CertSelector.match(generateCertificate)) { hashSet.add(generateCertificate); } } catch (Exception unused2) { } } } } } return hashSet; } catch (Exception e2) { throw new CertStoreException("certificate cannot be constructed from LDAP result: ".concat(String.valueOf(e2))); } } private Set a() throws CertStoreException { int i = 2 % 2; throw null; } private Set d() throws CertStoreException { int i = 2 % 2; throw null; } private Set c() throws CertStoreException { int i = 2 % 2; throw null; } @Override // java.security.cert.CertStoreSpi public Collection engineGetCRLs(CRLSelector cRLSelector) throws CertStoreException { int i = 2 % 2; throw null; } }