what-the-bank/sources/org/bouncycastle/asn1/x509/X509NameEntryConverter.java

41 lines
1.5 KiB
Java

package org.bouncycastle.asn1.x509;
import java.io.IOException;
import org.bouncycastle.asn1.ASN1InputStream;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.asn1.DERPrintableString;
import org.bouncycastle.util.Strings;
/* loaded from: classes6.dex */
public abstract class X509NameEntryConverter {
public abstract ASN1Primitive getConvertedValue(ASN1ObjectIdentifier aSN1ObjectIdentifier, String str);
/* JADX INFO: Access modifiers changed from: protected */
public ASN1Primitive convertHexEncoded(String str, int i) throws IOException {
String lowerCase = Strings.toLowerCase(str);
int length = (lowerCase.length() - i) / 2;
byte[] bArr = new byte[length];
for (int i2 = 0; i2 != length; i2++) {
int i3 = (i2 << 1) + i;
char charAt = lowerCase.charAt(i3);
char charAt2 = lowerCase.charAt(i3 + 1);
if (charAt < 'a') {
bArr[i2] = (byte) ((charAt - '0') << 4);
} else {
bArr[i2] = (byte) ((charAt - 'W') << 4);
}
if (charAt2 < 'a') {
bArr[i2] = (byte) (((byte) (charAt2 - '0')) | bArr[i2]);
} else {
bArr[i2] = (byte) (((byte) (charAt2 - 'W')) | bArr[i2]);
}
}
return new ASN1InputStream(bArr).readObject();
}
protected boolean canBePrintable(String str) {
return DERPrintableString.isPrintableString(str);
}
}