53 lines
1.6 KiB
Java
53 lines
1.6 KiB
Java
package com.facetec.sdk;
|
|
|
|
import java.security.cert.X509Certificate;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.LinkedHashSet;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import javax.security.auth.x500.X500Principal;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class mp implements mq {
|
|
private final Map<X500Principal, Set<X509Certificate>> d = new LinkedHashMap();
|
|
|
|
public mp(X509Certificate... x509CertificateArr) {
|
|
for (X509Certificate x509Certificate : x509CertificateArr) {
|
|
X500Principal subjectX500Principal = x509Certificate.getSubjectX500Principal();
|
|
Set<X509Certificate> set = this.d.get(subjectX500Principal);
|
|
if (set == null) {
|
|
set = new LinkedHashSet<>(1);
|
|
this.d.put(subjectX500Principal, set);
|
|
}
|
|
set.add(x509Certificate);
|
|
}
|
|
}
|
|
|
|
@Override // com.facetec.sdk.mq
|
|
public final X509Certificate a(X509Certificate x509Certificate) {
|
|
Set<X509Certificate> set = this.d.get(x509Certificate.getIssuerX500Principal());
|
|
if (set == null) {
|
|
return null;
|
|
}
|
|
for (X509Certificate x509Certificate2 : set) {
|
|
try {
|
|
x509Certificate.verify(x509Certificate2.getPublicKey());
|
|
return x509Certificate2;
|
|
} catch (Exception unused) {
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final boolean equals(Object obj) {
|
|
if (obj == this) {
|
|
return true;
|
|
}
|
|
return (obj instanceof mp) && ((mp) obj).d.equals(this.d);
|
|
}
|
|
|
|
public final int hashCode() {
|
|
return this.d.hashCode();
|
|
}
|
|
}
|