241 lines
12 KiB
Java
241 lines
12 KiB
Java
|
package org.bouncycastle.asn1.x500.style;
|
||
|
|
||
|
import com.huawei.hms.support.feature.result.CommonConstant;
|
||
|
import com.kofax.mobile.sdk._internal.impl.extraction.kta.KtaJsonExactionHelper;
|
||
|
import java.util.Hashtable;
|
||
|
import org.bouncycastle.asn1.ASN1Encodable;
|
||
|
import org.bouncycastle.asn1.ASN1GeneralizedTime;
|
||
|
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
|
||
|
import org.bouncycastle.asn1.DERIA5String;
|
||
|
import org.bouncycastle.asn1.DERPrintableString;
|
||
|
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
|
||
|
import org.bouncycastle.asn1.x500.RDN;
|
||
|
import org.bouncycastle.asn1.x500.X500Name;
|
||
|
import org.bouncycastle.asn1.x500.X500NameStyle;
|
||
|
import org.bouncycastle.asn1.x509.X509ObjectIdentifiers;
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public class BCStyle extends AbstractX500NameStyle {
|
||
|
public static final ASN1ObjectIdentifier BUSINESS_CATEGORY;
|
||
|
public static final ASN1ObjectIdentifier C;
|
||
|
public static final ASN1ObjectIdentifier CN;
|
||
|
public static final ASN1ObjectIdentifier COUNTRY_OF_CITIZENSHIP;
|
||
|
public static final ASN1ObjectIdentifier COUNTRY_OF_RESIDENCE;
|
||
|
public static final ASN1ObjectIdentifier DATE_OF_BIRTH;
|
||
|
public static final ASN1ObjectIdentifier DC;
|
||
|
public static final ASN1ObjectIdentifier DMD_NAME;
|
||
|
public static final ASN1ObjectIdentifier DN_QUALIFIER;
|
||
|
private static final Hashtable DefaultLookUp;
|
||
|
private static final Hashtable DefaultSymbols;
|
||
|
public static final ASN1ObjectIdentifier E;
|
||
|
public static final ASN1ObjectIdentifier EmailAddress;
|
||
|
public static final ASN1ObjectIdentifier GENDER;
|
||
|
public static final ASN1ObjectIdentifier GENERATION;
|
||
|
public static final ASN1ObjectIdentifier GIVENNAME;
|
||
|
public static final ASN1ObjectIdentifier INITIALS;
|
||
|
public static final X500NameStyle INSTANCE;
|
||
|
public static final ASN1ObjectIdentifier L;
|
||
|
public static final ASN1ObjectIdentifier NAME;
|
||
|
public static final ASN1ObjectIdentifier NAME_AT_BIRTH;
|
||
|
public static final ASN1ObjectIdentifier O;
|
||
|
public static final ASN1ObjectIdentifier OU;
|
||
|
public static final ASN1ObjectIdentifier PLACE_OF_BIRTH;
|
||
|
public static final ASN1ObjectIdentifier POSTAL_ADDRESS;
|
||
|
public static final ASN1ObjectIdentifier POSTAL_CODE;
|
||
|
public static final ASN1ObjectIdentifier PSEUDONYM;
|
||
|
public static final ASN1ObjectIdentifier SERIALNUMBER;
|
||
|
public static final ASN1ObjectIdentifier SN;
|
||
|
public static final ASN1ObjectIdentifier ST;
|
||
|
public static final ASN1ObjectIdentifier STREET;
|
||
|
public static final ASN1ObjectIdentifier SURNAME;
|
||
|
public static final ASN1ObjectIdentifier T;
|
||
|
public static final ASN1ObjectIdentifier TELEPHONE_NUMBER;
|
||
|
public static final ASN1ObjectIdentifier UID;
|
||
|
public static final ASN1ObjectIdentifier UNIQUE_IDENTIFIER;
|
||
|
public static final ASN1ObjectIdentifier UnstructuredAddress;
|
||
|
public static final ASN1ObjectIdentifier UnstructuredName;
|
||
|
protected final Hashtable defaultSymbols = copyHashTable(DefaultSymbols);
|
||
|
protected final Hashtable defaultLookUp = copyHashTable(DefaultLookUp);
|
||
|
|
||
|
@Override // org.bouncycastle.asn1.x500.X500NameStyle
|
||
|
public String toString(X500Name x500Name) {
|
||
|
StringBuffer stringBuffer = new StringBuffer();
|
||
|
boolean z = true;
|
||
|
for (RDN rdn : x500Name.getRDNs()) {
|
||
|
if (z) {
|
||
|
z = false;
|
||
|
} else {
|
||
|
stringBuffer.append(',');
|
||
|
}
|
||
|
IETFUtils.appendRDN(stringBuffer, rdn, this.defaultSymbols);
|
||
|
}
|
||
|
return stringBuffer.toString();
|
||
|
}
|
||
|
|
||
|
@Override // org.bouncycastle.asn1.x500.X500NameStyle
|
||
|
public String oidToDisplayName(ASN1ObjectIdentifier aSN1ObjectIdentifier) {
|
||
|
return (String) DefaultSymbols.get(aSN1ObjectIdentifier);
|
||
|
}
|
||
|
|
||
|
@Override // org.bouncycastle.asn1.x500.X500NameStyle
|
||
|
public String[] oidToAttrNames(ASN1ObjectIdentifier aSN1ObjectIdentifier) {
|
||
|
return IETFUtils.findAttrNamesForOID(aSN1ObjectIdentifier, this.defaultLookUp);
|
||
|
}
|
||
|
|
||
|
@Override // org.bouncycastle.asn1.x500.X500NameStyle
|
||
|
public RDN[] fromString(String str) {
|
||
|
return IETFUtils.rDNsFromString(str, this);
|
||
|
}
|
||
|
|
||
|
@Override // org.bouncycastle.asn1.x500.style.AbstractX500NameStyle
|
||
|
protected ASN1Encodable encodeStringValue(ASN1ObjectIdentifier aSN1ObjectIdentifier, String str) {
|
||
|
return (aSN1ObjectIdentifier.equals(EmailAddress) || aSN1ObjectIdentifier.equals(DC)) ? new DERIA5String(str) : aSN1ObjectIdentifier.equals(DATE_OF_BIRTH) ? new ASN1GeneralizedTime(str) : (aSN1ObjectIdentifier.equals(C) || aSN1ObjectIdentifier.equals(SN) || aSN1ObjectIdentifier.equals(DN_QUALIFIER) || aSN1ObjectIdentifier.equals(TELEPHONE_NUMBER)) ? new DERPrintableString(str) : super.encodeStringValue(aSN1ObjectIdentifier, str);
|
||
|
}
|
||
|
|
||
|
@Override // org.bouncycastle.asn1.x500.X500NameStyle
|
||
|
public ASN1ObjectIdentifier attrNameToOID(String str) {
|
||
|
return IETFUtils.decodeAttrName(str, this.defaultLookUp);
|
||
|
}
|
||
|
|
||
|
static {
|
||
|
ASN1ObjectIdentifier intern = new ASN1ObjectIdentifier("2.5.4.6").intern();
|
||
|
C = intern;
|
||
|
ASN1ObjectIdentifier intern2 = new ASN1ObjectIdentifier("2.5.4.10").intern();
|
||
|
O = intern2;
|
||
|
ASN1ObjectIdentifier intern3 = new ASN1ObjectIdentifier("2.5.4.11").intern();
|
||
|
OU = intern3;
|
||
|
ASN1ObjectIdentifier intern4 = new ASN1ObjectIdentifier("2.5.4.12").intern();
|
||
|
T = intern4;
|
||
|
ASN1ObjectIdentifier intern5 = new ASN1ObjectIdentifier("2.5.4.3").intern();
|
||
|
CN = intern5;
|
||
|
ASN1ObjectIdentifier intern6 = new ASN1ObjectIdentifier("2.5.4.5").intern();
|
||
|
SN = intern6;
|
||
|
ASN1ObjectIdentifier intern7 = new ASN1ObjectIdentifier("2.5.4.9").intern();
|
||
|
STREET = intern7;
|
||
|
SERIALNUMBER = intern6;
|
||
|
ASN1ObjectIdentifier intern8 = new ASN1ObjectIdentifier("2.5.4.7").intern();
|
||
|
L = intern8;
|
||
|
ASN1ObjectIdentifier intern9 = new ASN1ObjectIdentifier("2.5.4.8").intern();
|
||
|
ST = intern9;
|
||
|
ASN1ObjectIdentifier intern10 = new ASN1ObjectIdentifier("2.5.4.4").intern();
|
||
|
SURNAME = intern10;
|
||
|
ASN1ObjectIdentifier intern11 = new ASN1ObjectIdentifier("2.5.4.42").intern();
|
||
|
GIVENNAME = intern11;
|
||
|
ASN1ObjectIdentifier intern12 = new ASN1ObjectIdentifier("2.5.4.43").intern();
|
||
|
INITIALS = intern12;
|
||
|
ASN1ObjectIdentifier intern13 = new ASN1ObjectIdentifier("2.5.4.44").intern();
|
||
|
GENERATION = intern13;
|
||
|
ASN1ObjectIdentifier intern14 = new ASN1ObjectIdentifier("2.5.4.45").intern();
|
||
|
UNIQUE_IDENTIFIER = intern14;
|
||
|
ASN1ObjectIdentifier intern15 = new ASN1ObjectIdentifier("2.5.4.15").intern();
|
||
|
BUSINESS_CATEGORY = intern15;
|
||
|
ASN1ObjectIdentifier intern16 = new ASN1ObjectIdentifier("2.5.4.17").intern();
|
||
|
POSTAL_CODE = intern16;
|
||
|
ASN1ObjectIdentifier intern17 = new ASN1ObjectIdentifier("2.5.4.46").intern();
|
||
|
DN_QUALIFIER = intern17;
|
||
|
ASN1ObjectIdentifier intern18 = new ASN1ObjectIdentifier("2.5.4.65").intern();
|
||
|
PSEUDONYM = intern18;
|
||
|
ASN1ObjectIdentifier intern19 = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.1").intern();
|
||
|
DATE_OF_BIRTH = intern19;
|
||
|
ASN1ObjectIdentifier intern20 = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.2").intern();
|
||
|
PLACE_OF_BIRTH = intern20;
|
||
|
ASN1ObjectIdentifier intern21 = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.3").intern();
|
||
|
GENDER = intern21;
|
||
|
ASN1ObjectIdentifier intern22 = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.4").intern();
|
||
|
COUNTRY_OF_CITIZENSHIP = intern22;
|
||
|
ASN1ObjectIdentifier intern23 = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.5").intern();
|
||
|
COUNTRY_OF_RESIDENCE = intern23;
|
||
|
ASN1ObjectIdentifier intern24 = new ASN1ObjectIdentifier("1.3.36.8.3.14").intern();
|
||
|
NAME_AT_BIRTH = intern24;
|
||
|
ASN1ObjectIdentifier intern25 = new ASN1ObjectIdentifier("2.5.4.16").intern();
|
||
|
POSTAL_ADDRESS = intern25;
|
||
|
DMD_NAME = new ASN1ObjectIdentifier("2.5.4.54").intern();
|
||
|
ASN1ObjectIdentifier aSN1ObjectIdentifier = X509ObjectIdentifiers.id_at_telephoneNumber;
|
||
|
TELEPHONE_NUMBER = aSN1ObjectIdentifier;
|
||
|
ASN1ObjectIdentifier aSN1ObjectIdentifier2 = X509ObjectIdentifiers.id_at_name;
|
||
|
NAME = aSN1ObjectIdentifier2;
|
||
|
ASN1ObjectIdentifier aSN1ObjectIdentifier3 = PKCSObjectIdentifiers.pkcs_9_at_emailAddress;
|
||
|
EmailAddress = aSN1ObjectIdentifier3;
|
||
|
ASN1ObjectIdentifier aSN1ObjectIdentifier4 = PKCSObjectIdentifiers.pkcs_9_at_unstructuredName;
|
||
|
UnstructuredName = aSN1ObjectIdentifier4;
|
||
|
ASN1ObjectIdentifier aSN1ObjectIdentifier5 = PKCSObjectIdentifiers.pkcs_9_at_unstructuredAddress;
|
||
|
UnstructuredAddress = aSN1ObjectIdentifier5;
|
||
|
E = aSN1ObjectIdentifier3;
|
||
|
ASN1ObjectIdentifier aSN1ObjectIdentifier6 = new ASN1ObjectIdentifier("0.9.2342.19200300.100.1.25");
|
||
|
DC = aSN1ObjectIdentifier6;
|
||
|
ASN1ObjectIdentifier aSN1ObjectIdentifier7 = new ASN1ObjectIdentifier("0.9.2342.19200300.100.1.1");
|
||
|
UID = aSN1ObjectIdentifier7;
|
||
|
Hashtable hashtable = new Hashtable();
|
||
|
DefaultSymbols = hashtable;
|
||
|
Hashtable hashtable2 = new Hashtable();
|
||
|
DefaultLookUp = hashtable2;
|
||
|
hashtable.put(intern, "C");
|
||
|
hashtable.put(intern2, "O");
|
||
|
hashtable.put(intern4, "T");
|
||
|
hashtable.put(intern3, "OU");
|
||
|
hashtable.put(intern5, "CN");
|
||
|
hashtable.put(intern8, "L");
|
||
|
hashtable.put(intern9, "ST");
|
||
|
hashtable.put(intern6, "SERIALNUMBER");
|
||
|
hashtable.put(aSN1ObjectIdentifier3, "E");
|
||
|
hashtable.put(aSN1ObjectIdentifier6, "DC");
|
||
|
hashtable.put(aSN1ObjectIdentifier7, "UID");
|
||
|
hashtable.put(intern7, "STREET");
|
||
|
hashtable.put(intern10, "SURNAME");
|
||
|
hashtable.put(intern11, "GIVENNAME");
|
||
|
hashtable.put(intern12, "INITIALS");
|
||
|
hashtable.put(intern13, "GENERATION");
|
||
|
hashtable.put(aSN1ObjectIdentifier5, "unstructuredAddress");
|
||
|
hashtable.put(aSN1ObjectIdentifier4, "unstructuredName");
|
||
|
hashtable.put(intern14, "UniqueIdentifier");
|
||
|
hashtable.put(intern17, "DN");
|
||
|
hashtable.put(intern18, "Pseudonym");
|
||
|
hashtable.put(intern25, "PostalAddress");
|
||
|
hashtable.put(intern24, "NameAtBirth");
|
||
|
hashtable.put(intern22, "CountryOfCitizenship");
|
||
|
hashtable.put(intern23, "CountryOfResidence");
|
||
|
hashtable.put(intern21, "Gender");
|
||
|
hashtable.put(intern20, "PlaceOfBirth");
|
||
|
hashtable.put(intern19, "DateOfBirth");
|
||
|
hashtable.put(intern16, "PostalCode");
|
||
|
hashtable.put(intern15, "BusinessCategory");
|
||
|
hashtable.put(aSN1ObjectIdentifier, "TelephoneNumber");
|
||
|
hashtable.put(aSN1ObjectIdentifier2, KtaJsonExactionHelper.NAME);
|
||
|
hashtable2.put("c", intern);
|
||
|
hashtable2.put("o", intern2);
|
||
|
hashtable2.put("t", intern4);
|
||
|
hashtable2.put("ou", intern3);
|
||
|
hashtable2.put("cn", intern5);
|
||
|
hashtable2.put("l", intern8);
|
||
|
hashtable2.put("st", intern9);
|
||
|
hashtable2.put("sn", intern6);
|
||
|
hashtable2.put("serialnumber", intern6);
|
||
|
hashtable2.put("street", intern7);
|
||
|
hashtable2.put("emailaddress", aSN1ObjectIdentifier3);
|
||
|
hashtable2.put("dc", aSN1ObjectIdentifier6);
|
||
|
hashtable2.put("e", aSN1ObjectIdentifier3);
|
||
|
hashtable2.put(CommonConstant.KEY_UID, aSN1ObjectIdentifier7);
|
||
|
hashtable2.put("surname", intern10);
|
||
|
hashtable2.put("givenname", intern11);
|
||
|
hashtable2.put("initials", intern12);
|
||
|
hashtable2.put("generation", intern13);
|
||
|
hashtable2.put("unstructuredaddress", aSN1ObjectIdentifier5);
|
||
|
hashtable2.put("unstructuredname", aSN1ObjectIdentifier4);
|
||
|
hashtable2.put("uniqueidentifier", intern14);
|
||
|
hashtable2.put("dn", intern17);
|
||
|
hashtable2.put("pseudonym", intern18);
|
||
|
hashtable2.put("postaladdress", intern25);
|
||
|
hashtable2.put("nameofbirth", intern24);
|
||
|
hashtable2.put("countryofcitizenship", intern22);
|
||
|
hashtable2.put("countryofresidence", intern23);
|
||
|
hashtable2.put(CommonConstant.KEY_GENDER, intern21);
|
||
|
hashtable2.put("placeofbirth", intern20);
|
||
|
hashtable2.put("dateofbirth", intern19);
|
||
|
hashtable2.put("postalcode", intern16);
|
||
|
hashtable2.put("businesscategory", intern15);
|
||
|
hashtable2.put("telephonenumber", aSN1ObjectIdentifier);
|
||
|
hashtable2.put("name", aSN1ObjectIdentifier2);
|
||
|
INSTANCE = new BCStyle();
|
||
|
}
|
||
|
}
|