what-the-bank/sources/org/bouncycastle/jce/provider/PKIXAttrCertPathBuilderSpi....

86 lines
4.5 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package org.bouncycastle.jce.provider;
import java.security.InvalidAlgorithmParameterException;
import java.security.cert.CertPathBuilderException;
import java.security.cert.CertPathBuilderResult;
import java.security.cert.CertPathBuilderSpi;
import java.security.cert.CertPathParameters;
import java.security.cert.PKIXBuilderParameters;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import org.bouncycastle.jcajce.PKIXExtendedBuilderParameters;
import org.bouncycastle.util.Store;
import org.bouncycastle.util.StoreException;
import org.bouncycastle.x509.ExtendedPKIXBuilderParameters;
import org.bouncycastle.x509.ExtendedPKIXParameters;
import org.bouncycastle.x509.X509AttributeCertStoreSelector;
/* loaded from: classes6.dex */
public class PKIXAttrCertPathBuilderSpi extends CertPathBuilderSpi {
private Exception certPathException;
@Override // java.security.cert.CertPathBuilderSpi
public CertPathBuilderResult engineBuild(CertPathParameters certPathParameters) throws CertPathBuilderException, InvalidAlgorithmParameterException {
PKIXExtendedBuilderParameters pKIXExtendedBuilderParameters;
boolean z = certPathParameters instanceof PKIXBuilderParameters;
if (!z && !(certPathParameters instanceof ExtendedPKIXBuilderParameters) && !(certPathParameters instanceof PKIXExtendedBuilderParameters)) {
StringBuilder sb = new StringBuilder("Parameters must be an instance of ");
sb.append(PKIXBuilderParameters.class.getName());
sb.append(" or ");
sb.append(PKIXExtendedBuilderParameters.class.getName());
sb.append(".");
throw new InvalidAlgorithmParameterException(sb.toString());
}
new ArrayList();
if (z) {
PKIXExtendedBuilderParameters.Builder builder = new PKIXExtendedBuilderParameters.Builder((PKIXBuilderParameters) certPathParameters);
if (certPathParameters instanceof ExtendedPKIXParameters) {
ExtendedPKIXBuilderParameters extendedPKIXBuilderParameters = (ExtendedPKIXBuilderParameters) certPathParameters;
builder.addExcludedCerts(extendedPKIXBuilderParameters.getExcludedCerts());
builder.setMaxPathLength(extendedPKIXBuilderParameters.getMaxPathLength());
extendedPKIXBuilderParameters.getStores();
}
pKIXExtendedBuilderParameters = builder.build();
} else {
pKIXExtendedBuilderParameters = (PKIXExtendedBuilderParameters) certPathParameters;
}
new ArrayList();
pKIXExtendedBuilderParameters.getBaseParameters().getTargetConstraints();
StringBuilder sb2 = new StringBuilder("TargetConstraints must be an instance of ");
sb2.append(X509AttributeCertStoreSelector.class.getName());
sb2.append(" for ");
sb2.append(getClass().getName());
sb2.append(" class.");
throw new CertPathBuilderException(sb2.toString());
}
protected static Collection findCertificates(X509AttributeCertStoreSelector x509AttributeCertStoreSelector, List list) throws AnnotatedException {
HashSet hashSet = new HashSet();
for (Object obj : list) {
if (obj instanceof Store) {
try {
hashSet.addAll(((Store) obj).getMatches(x509AttributeCertStoreSelector));
} catch (StoreException e) {
throw new AnnotatedException("Problem while picking certificates from X.509 store.", e);
}
}
}
return hashSet;
}
/* JADX WARN: Removed duplicated region for block: B:43:0x010b */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private java.security.cert.CertPathBuilderResult build(org.bouncycastle.x509.X509AttributeCertificate r6, java.security.cert.X509Certificate r7, org.bouncycastle.jcajce.PKIXExtendedBuilderParameters r8, java.util.List r9) {
/*
Method dump skipped, instructions count: 279
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.jce.provider.PKIXAttrCertPathBuilderSpi.build(org.bouncycastle.x509.X509AttributeCertificate, java.security.cert.X509Certificate, org.bouncycastle.jcajce.PKIXExtendedBuilderParameters, java.util.List):java.security.cert.CertPathBuilderResult");
}
}