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

56 lines
2.1 KiB
Java

package o;
import java.security.PublicKey;
import java.security.interfaces.ECPublicKey;
import java.security.interfaces.RSAPublicKey;
import org.ejbca.cvc.exception.ConstructionException;
/* renamed from: o.gme, reason: case insensitive filesystem */
/* loaded from: classes6.dex */
public final class C15290gme {
public static glP e(PublicKey publicKey, String str, InterfaceC15243glE interfaceC15243glE) throws ConstructionException {
if (publicKey instanceof glP) {
return (glP) publicKey;
}
C15288gmc a = glH.a(str);
if (a.d.startsWith("0.4.0.127.0.7.2.2.2.1")) {
return new C15289gmd(a, (RSAPublicKey) publicKey);
}
if (a.d.startsWith("0.4.0.127.0.7.2.2.2.2")) {
return new C15286gma(a, (ECPublicKey) publicKey, interfaceC15243glE);
}
throw new IllegalArgumentException("Unknown key type: ".concat(String.valueOf(a)));
}
/* JADX INFO: Access modifiers changed from: package-private */
public static glP d(glY gly) throws ConstructionException {
try {
C15288gmc c15288gmc = (C15288gmc) gly.b.get(glS.OID);
if (c15288gmc.d.startsWith("0.4.0.127.0.7.2.2.2.1")) {
d(glS.COEFFICIENT_A, glS.EXPONENT, gly);
return new C15289gmd(gly);
}
if (c15288gmc.d.startsWith("0.4.0.127.0.7.2.2.2.2")) {
d(glS.EXPONENT, glS.COEFFICIENT_A, gly);
return new C15286gma(gly);
}
StringBuilder sb = new StringBuilder("Unknown public key OID: ");
sb.append(c15288gmc.d);
throw new IllegalArgumentException(sb.toString());
} catch (NoSuchFieldException e) {
throw new ConstructionException(e);
}
}
private static void d(glS gls, glS gls2, glY gly) throws ConstructionException {
glK glk;
if (gls.value != gls2.value) {
throw new IllegalArgumentException("Tag values are not equal");
}
if (((glK) gly.b.get(gls2)) != null || (glk = (glK) gly.b.get(gls)) == null) {
return;
}
gly.c(new glK(gls2, glk.d));
}
}