205 lines
7.8 KiB
Java
205 lines
7.8 KiB
Java
package org.bouncycastle.jcajce;
|
|
|
|
import java.math.BigInteger;
|
|
import java.security.cert.CRL;
|
|
import java.security.cert.CRLSelector;
|
|
import java.security.cert.CertStore;
|
|
import java.security.cert.CertStoreException;
|
|
import java.security.cert.X509CRLSelector;
|
|
import java.security.cert.X509Certificate;
|
|
import java.util.Collection;
|
|
import org.bouncycastle.util.Arrays;
|
|
import org.bouncycastle.util.Selector;
|
|
|
|
/* loaded from: classes6.dex */
|
|
public class PKIXCRLStoreSelector<T extends CRL> implements Selector<T> {
|
|
private final CRLSelector baseSelector;
|
|
private final boolean completeCRLEnabled;
|
|
private final boolean deltaCRLIndicator;
|
|
private final byte[] issuingDistributionPoint;
|
|
private final boolean issuingDistributionPointEnabled;
|
|
private final BigInteger maxBaseCRLNumber;
|
|
|
|
@Override // org.bouncycastle.util.Selector
|
|
public Object clone() {
|
|
return this;
|
|
}
|
|
|
|
/* loaded from: classes6.dex */
|
|
public static class Builder {
|
|
private final CRLSelector baseSelector;
|
|
private boolean deltaCRLIndicator = false;
|
|
private boolean completeCRLEnabled = false;
|
|
private BigInteger maxBaseCRLNumber = null;
|
|
private byte[] issuingDistributionPoint = null;
|
|
private boolean issuingDistributionPointEnabled = false;
|
|
|
|
public void setMaxBaseCRLNumber(BigInteger bigInteger) {
|
|
this.maxBaseCRLNumber = bigInteger;
|
|
}
|
|
|
|
public void setIssuingDistributionPointEnabled(boolean z) {
|
|
this.issuingDistributionPointEnabled = z;
|
|
}
|
|
|
|
public void setIssuingDistributionPoint(byte[] bArr) {
|
|
this.issuingDistributionPoint = Arrays.clone(bArr);
|
|
}
|
|
|
|
public Builder setDeltaCRLIndicatorEnabled(boolean z) {
|
|
this.deltaCRLIndicator = z;
|
|
return this;
|
|
}
|
|
|
|
public Builder setCompleteCRLEnabled(boolean z) {
|
|
this.completeCRLEnabled = z;
|
|
return this;
|
|
}
|
|
|
|
public PKIXCRLStoreSelector<? extends CRL> build() {
|
|
return new PKIXCRLStoreSelector<>(this);
|
|
}
|
|
|
|
public Builder(CRLSelector cRLSelector) {
|
|
this.baseSelector = (CRLSelector) cRLSelector.clone();
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:30:0x0062, code lost:
|
|
|
|
if (org.bouncycastle.util.Arrays.areEqual(r0, r2) == false) goto L36;
|
|
*/
|
|
@Override // org.bouncycastle.util.Selector
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public boolean match(java.security.cert.CRL r5) {
|
|
/*
|
|
r4 = this;
|
|
boolean r0 = r5 instanceof java.security.cert.X509CRL
|
|
if (r0 != 0) goto L5
|
|
goto L65
|
|
L5:
|
|
r0 = r5
|
|
java.security.cert.X509CRL r0 = (java.security.cert.X509CRL) r0
|
|
r1 = 0
|
|
org.bouncycastle.asn1.ASN1ObjectIdentifier r2 = org.bouncycastle.asn1.x509.Extension.deltaCRLIndicator // Catch: java.lang.Exception -> L6c
|
|
java.lang.String r2 = r2.getId() // Catch: java.lang.Exception -> L6c
|
|
byte[] r2 = r0.getExtensionValue(r2) // Catch: java.lang.Exception -> L6c
|
|
if (r2 == 0) goto L22
|
|
org.bouncycastle.asn1.ASN1OctetString r2 = org.bouncycastle.asn1.ASN1OctetString.getInstance(r2) // Catch: java.lang.Exception -> L6c
|
|
byte[] r2 = r2.getOctets() // Catch: java.lang.Exception -> L6c
|
|
org.bouncycastle.asn1.ASN1Integer r2 = org.bouncycastle.asn1.ASN1Integer.getInstance(r2) // Catch: java.lang.Exception -> L6c
|
|
goto L23
|
|
L22:
|
|
r2 = 0
|
|
L23:
|
|
boolean r3 = r4.isDeltaCRLIndicatorEnabled()
|
|
if (r3 == 0) goto L2c
|
|
if (r2 != 0) goto L2c
|
|
return r1
|
|
L2c:
|
|
boolean r3 = r4.isCompleteCRLEnabled()
|
|
if (r3 == 0) goto L35
|
|
if (r2 == 0) goto L35
|
|
return r1
|
|
L35:
|
|
if (r2 == 0) goto L49
|
|
java.math.BigInteger r3 = r4.maxBaseCRLNumber
|
|
if (r3 == 0) goto L49
|
|
java.math.BigInteger r2 = r2.getPositiveValue()
|
|
java.math.BigInteger r3 = r4.maxBaseCRLNumber
|
|
int r2 = r2.compareTo(r3)
|
|
r3 = 1
|
|
if (r2 != r3) goto L49
|
|
return r1
|
|
L49:
|
|
boolean r2 = r4.issuingDistributionPointEnabled
|
|
if (r2 == 0) goto L65
|
|
org.bouncycastle.asn1.ASN1ObjectIdentifier r2 = org.bouncycastle.asn1.x509.Extension.issuingDistributionPoint
|
|
java.lang.String r2 = r2.getId()
|
|
byte[] r0 = r0.getExtensionValue(r2)
|
|
byte[] r2 = r4.issuingDistributionPoint
|
|
if (r2 != 0) goto L5e
|
|
if (r0 == 0) goto L65
|
|
return r1
|
|
L5e:
|
|
boolean r0 = org.bouncycastle.util.Arrays.areEqual(r0, r2)
|
|
if (r0 != 0) goto L65
|
|
goto L6c
|
|
L65:
|
|
java.security.cert.CRLSelector r0 = r4.baseSelector
|
|
boolean r5 = r0.match(r5)
|
|
return r5
|
|
L6c:
|
|
return r1
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: org.bouncycastle.jcajce.PKIXCRLStoreSelector.match(java.security.cert.CRL):boolean");
|
|
}
|
|
|
|
public boolean isIssuingDistributionPointEnabled() {
|
|
return this.issuingDistributionPointEnabled;
|
|
}
|
|
|
|
public boolean isDeltaCRLIndicatorEnabled() {
|
|
return this.deltaCRLIndicator;
|
|
}
|
|
|
|
public boolean isCompleteCRLEnabled() {
|
|
return this.completeCRLEnabled;
|
|
}
|
|
|
|
public BigInteger getMaxBaseCRLNumber() {
|
|
return this.maxBaseCRLNumber;
|
|
}
|
|
|
|
public byte[] getIssuingDistributionPoint() {
|
|
return Arrays.clone(this.issuingDistributionPoint);
|
|
}
|
|
|
|
public X509Certificate getCertificateChecking() {
|
|
CRLSelector cRLSelector = this.baseSelector;
|
|
if (cRLSelector instanceof X509CRLSelector) {
|
|
return ((X509CRLSelector) cRLSelector).getCertificateChecking();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public static Collection<? extends CRL> getCRLs(PKIXCRLStoreSelector pKIXCRLStoreSelector, CertStore certStore) throws CertStoreException {
|
|
return certStore.getCRLs(new SelectorClone(pKIXCRLStoreSelector));
|
|
}
|
|
|
|
/* loaded from: classes6.dex */
|
|
static class SelectorClone extends X509CRLSelector {
|
|
private final PKIXCRLStoreSelector selector;
|
|
|
|
@Override // java.security.cert.X509CRLSelector, java.security.cert.CRLSelector
|
|
public boolean match(CRL crl) {
|
|
PKIXCRLStoreSelector pKIXCRLStoreSelector = this.selector;
|
|
return pKIXCRLStoreSelector == null ? crl != null : pKIXCRLStoreSelector.match(crl);
|
|
}
|
|
|
|
SelectorClone(PKIXCRLStoreSelector pKIXCRLStoreSelector) {
|
|
this.selector = pKIXCRLStoreSelector;
|
|
if (pKIXCRLStoreSelector.baseSelector instanceof X509CRLSelector) {
|
|
X509CRLSelector x509CRLSelector = (X509CRLSelector) pKIXCRLStoreSelector.baseSelector;
|
|
setCertificateChecking(x509CRLSelector.getCertificateChecking());
|
|
setDateAndTime(x509CRLSelector.getDateAndTime());
|
|
setIssuers(x509CRLSelector.getIssuers());
|
|
setMinCRLNumber(x509CRLSelector.getMinCRL());
|
|
setMaxCRLNumber(x509CRLSelector.getMaxCRL());
|
|
}
|
|
}
|
|
}
|
|
|
|
private PKIXCRLStoreSelector(Builder builder) {
|
|
this.baseSelector = builder.baseSelector;
|
|
this.deltaCRLIndicator = builder.deltaCRLIndicator;
|
|
this.completeCRLEnabled = builder.completeCRLEnabled;
|
|
this.maxBaseCRLNumber = builder.maxBaseCRLNumber;
|
|
this.issuingDistributionPoint = builder.issuingDistributionPoint;
|
|
this.issuingDistributionPointEnabled = builder.issuingDistributionPointEnabled;
|
|
}
|
|
}
|