what-the-bank/sources/o/C1128Wem.java

83 lines
2.5 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import java.security.GeneralSecurityException;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.logging.Logger;
/* renamed from: o.Wem, reason: case insensitive filesystem */
/* loaded from: classes2.dex */
public final class C1128Wem {
static final Logger b = Logger.getLogger(C1128Wem.class.getName());
final ConcurrentMap<String, LWm> d;
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: o.Wem$LWm */
/* loaded from: classes2.dex */
public interface LWm {
Class<?> a();
Set<Class<?>> b();
<P> RQY<P> b(Class<P> cls) throws GeneralSecurityException;
RQY<?> e();
}
/* JADX INFO: Access modifiers changed from: package-private */
public C1128Wem(C1128Wem c1128Wem) {
this.d = new ConcurrentHashMap(c1128Wem.d);
}
/* JADX INFO: Access modifiers changed from: package-private */
public C1128Wem() {
this.d = new ConcurrentHashMap();
}
/* JADX INFO: Access modifiers changed from: package-private */
public final LWm b(String str) throws GeneralSecurityException {
LWm lWm;
synchronized (this) {
if (!this.d.containsKey(str)) {
StringBuilder sb = new StringBuilder("No key manager found for key type ");
sb.append(str);
throw new GeneralSecurityException(sb.toString());
}
lWm = this.d.get(str);
}
return lWm;
}
private static String d(Set<Class<?>> set) {
StringBuilder sb = new StringBuilder();
boolean z = true;
for (Class<?> cls : set) {
if (!z) {
sb.append(", ");
}
sb.append(cls.getCanonicalName());
z = false;
}
return sb.toString();
}
/* JADX INFO: Access modifiers changed from: package-private */
public final <P> RQY<P> c(String str, Class<P> cls) throws GeneralSecurityException {
LWm b2 = b(str);
if (cls == null) {
return (RQY<P>) b2.e();
}
if (b2.b().contains(cls)) {
return b2.b(cls);
}
StringBuilder sb = new StringBuilder("Primitive type ");
sb.append(cls.getName());
sb.append(" not supported by key manager of type ");
sb.append(b2.a());
sb.append(", supported primitives: ");
sb.append(d(b2.b()));
throw new GeneralSecurityException(sb.toString());
}
}