米多多 v3.0.1版本的 MD5 值为:f69e79dbe1787218a397ad907fb8f3ab
以下内容为反编译后的 BCStyle.java 源代码,内容仅作参考
package org.eid_bc.bouncycastle.asn1.x500.style;
import androidx.core.content.FileProvider;
import c.i.v2;
import com.dtf.toyger.base.face.ToygerFaceService;
import java.util.Hashtable;
import org.eid_bc.bouncycastle.asn1.ASN1Encodable;
import org.eid_bc.bouncycastle.asn1.ASN1GeneralizedTime;
import org.eid_bc.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.eid_bc.bouncycastle.asn1.DERIA5String;
import org.eid_bc.bouncycastle.asn1.DERPrintableString;
import org.eid_bc.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
import org.eid_bc.bouncycastle.asn1.x500.RDN;
import org.eid_bc.bouncycastle.asn1.x500.X500Name;
import org.eid_bc.bouncycastle.asn1.x500.X500NameStyle;
import org.eid_bc.bouncycastle.asn1.x509.X509ObjectIdentifiers;
public class BCStyle extends AbstractX500NameStyle {
public static final X500NameStyle INSTANCE;
public static final ASN1ObjectIdentifier C = new ASN1ObjectIdentifier("2.5.4.6").intern();
public static final ASN1ObjectIdentifier O = new ASN1ObjectIdentifier("2.5.4.10").intern();
public static final ASN1ObjectIdentifier OU = new ASN1ObjectIdentifier("2.5.4.11").intern();
public static final ASN1ObjectIdentifier T = new ASN1ObjectIdentifier("2.5.4.12").intern();
public static final ASN1ObjectIdentifier CN = new ASN1ObjectIdentifier("2.5.4.3").intern();
public static final ASN1ObjectIdentifier SN = new ASN1ObjectIdentifier("2.5.4.5").intern();
public static final ASN1ObjectIdentifier STREET = new ASN1ObjectIdentifier("2.5.4.9").intern();
public static final ASN1ObjectIdentifier L = new ASN1ObjectIdentifier("2.5.4.7").intern();
public static final ASN1ObjectIdentifier ST = new ASN1ObjectIdentifier("2.5.4.8").intern();
public static final ASN1ObjectIdentifier SURNAME = new ASN1ObjectIdentifier("2.5.4.4").intern();
public static final ASN1ObjectIdentifier GIVENNAME = new ASN1ObjectIdentifier("2.5.4.42").intern();
public static final ASN1ObjectIdentifier INITIALS = new ASN1ObjectIdentifier("2.5.4.43").intern();
public static final ASN1ObjectIdentifier GENERATION = new ASN1ObjectIdentifier("2.5.4.44").intern();
public static final ASN1ObjectIdentifier UNIQUE_IDENTIFIER = new ASN1ObjectIdentifier("2.5.4.45").intern();
public static final ASN1ObjectIdentifier BUSINESS_CATEGORY = new ASN1ObjectIdentifier("2.5.4.15").intern();
public static final ASN1ObjectIdentifier POSTAL_CODE = new ASN1ObjectIdentifier("2.5.4.17").intern();
public static final ASN1ObjectIdentifier DN_QUALIFIER = new ASN1ObjectIdentifier("2.5.4.46").intern();
public static final ASN1ObjectIdentifier PSEUDONYM = new ASN1ObjectIdentifier("2.5.4.65").intern();
public static final ASN1ObjectIdentifier DATE_OF_BIRTH = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.1").intern();
public static final ASN1ObjectIdentifier PLACE_OF_BIRTH = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.2").intern();
public static final ASN1ObjectIdentifier GENDER = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.3").intern();
public static final ASN1ObjectIdentifier COUNTRY_OF_CITIZENSHIP = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.4").intern();
public static final ASN1ObjectIdentifier COUNTRY_OF_RESIDENCE = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.5").intern();
public static final ASN1ObjectIdentifier NAME_AT_BIRTH = new ASN1ObjectIdentifier("1.3.36.8.3.14").intern();
public static final ASN1ObjectIdentifier POSTAL_ADDRESS = new ASN1ObjectIdentifier("2.5.4.16").intern();
public static final ASN1ObjectIdentifier DMD_NAME = new ASN1ObjectIdentifier("2.5.4.54").intern();
public static final ASN1ObjectIdentifier TELEPHONE_NUMBER = X509ObjectIdentifiers.id_at_telephoneNumber;
public static final ASN1ObjectIdentifier NAME = X509ObjectIdentifiers.id_at_name;
public static final ASN1ObjectIdentifier ORGANIZATION_IDENTIFIER = X509ObjectIdentifiers.id_at_organizationIdentifier;
public static final ASN1ObjectIdentifier EmailAddress = PKCSObjectIdentifiers.pkcs_9_at_emailAddress;
public static final ASN1ObjectIdentifier UnstructuredName = PKCSObjectIdentifiers.pkcs_9_at_unstructuredName;
public static final ASN1ObjectIdentifier UnstructuredAddress = PKCSObjectIdentifiers.pkcs_9_at_unstructuredAddress;
public static final ASN1ObjectIdentifier E = EmailAddress;
public static final ASN1ObjectIdentifier DC = new ASN1ObjectIdentifier("0.9.2342.19200300.100.1.25");
public static final ASN1ObjectIdentifier UID = new ASN1ObjectIdentifier("0.9.2342.19200300.100.1.1");
public static final Hashtable DefaultSymbols = new Hashtable();
public static final Hashtable DefaultLookUp = new Hashtable();
public final Hashtable defaultSymbols = AbstractX500NameStyle.copyHashTable(DefaultSymbols);
public final Hashtable defaultLookUp = AbstractX500NameStyle.copyHashTable(DefaultLookUp);
static {
DefaultSymbols.put(C, "C");
DefaultSymbols.put(O, "O");
DefaultSymbols.put(T, "T");
DefaultSymbols.put(OU, "OU");
DefaultSymbols.put(CN, "CN");
DefaultSymbols.put(L, "L");
DefaultSymbols.put(ST, "ST");
DefaultSymbols.put(SN, "SERIALNUMBER");
DefaultSymbols.put(EmailAddress, "E");
DefaultSymbols.put(DC, "DC");
DefaultSymbols.put(UID, "UID");
DefaultSymbols.put(STREET, "STREET");
DefaultSymbols.put(SURNAME, "SURNAME");
DefaultSymbols.put(GIVENNAME, "GIVENNAME");
DefaultSymbols.put(INITIALS, "INITIALS");
DefaultSymbols.put(GENERATION, "GENERATION");
DefaultSymbols.put(UnstructuredAddress, "unstructuredAddress");
DefaultSymbols.put(UnstructuredName, "unstructuredName");
DefaultSymbols.put(UNIQUE_IDENTIFIER, "UniqueIdentifier");
DefaultSymbols.put(DN_QUALIFIER, "DN");
DefaultSymbols.put(PSEUDONYM, "Pseudonym");
DefaultSymbols.put(POSTAL_ADDRESS, "PostalAddress");
DefaultSymbols.put(NAME_AT_BIRTH, "NameAtBirth");
DefaultSymbols.put(COUNTRY_OF_CITIZENSHIP, "CountryOfCitizenship");
DefaultSymbols.put(COUNTRY_OF_RESIDENCE, "CountryOfResidence");
DefaultSymbols.put(GENDER, "Gender");
DefaultSymbols.put(PLACE_OF_BIRTH, "PlaceOfBirth");
DefaultSymbols.put(DATE_OF_BIRTH, "DateOfBirth");
DefaultSymbols.put(POSTAL_CODE, "PostalCode");
DefaultSymbols.put(BUSINESS_CATEGORY, "BusinessCategory");
DefaultSymbols.put(TELEPHONE_NUMBER, "TelephoneNumber");
DefaultSymbols.put(NAME, "Name");
DefaultSymbols.put(ORGANIZATION_IDENTIFIER, "organizationIdentifier");
DefaultLookUp.put(v2.f5574c, C);
DefaultLookUp.put("o", O);
DefaultLookUp.put("t", T);
DefaultLookUp.put("ou", OU);
DefaultLookUp.put("cn", CN);
DefaultLookUp.put("l", L);
DefaultLookUp.put("st", ST);
DefaultLookUp.put("sn", SN);
DefaultLookUp.put("serialnumber", SN);
DefaultLookUp.put("street", STREET);
DefaultLookUp.put("emailaddress", E);
DefaultLookUp.put("dc", DC);
DefaultLookUp.put("e", E);
DefaultLookUp.put(ToygerFaceService.KEY_TOYGER_UID, UID);
DefaultLookUp.put("surname", SURNAME);
DefaultLookUp.put("givenname", GIVENNAME);
DefaultLookUp.put("initials", INITIALS);
DefaultLookUp.put("generation", GENERATION);
DefaultLookUp.put("unstructuredaddress", UnstructuredAddress);
DefaultLookUp.put("unstructuredname", UnstructuredName);
DefaultLookUp.put("uniqueidentifier", UNIQUE_IDENTIFIER);
DefaultLookUp.put("dn", DN_QUALIFIER);
DefaultLookUp.put("pseudonym", PSEUDONYM);
DefaultLookUp.put("postaladdress", POSTAL_ADDRESS);
DefaultLookUp.put("nameofbirth", NAME_AT_BIRTH);
DefaultLookUp.put("countryofcitizenship", COUNTRY_OF_CITIZENSHIP);
DefaultLookUp.put("countryofresidence", COUNTRY_OF_RESIDENCE);
DefaultLookUp.put("gender", GENDER);
DefaultLookUp.put("placeofbirth", PLACE_OF_BIRTH);
DefaultLookUp.put("dateofbirth", DATE_OF_BIRTH);
DefaultLookUp.put("postalcode", POSTAL_CODE);
DefaultLookUp.put("businesscategory", BUSINESS_CATEGORY);
DefaultLookUp.put("telephonenumber", TELEPHONE_NUMBER);
DefaultLookUp.put(FileProvider.ATTR_NAME, NAME);
DefaultLookUp.put("organizationidentifier", ORGANIZATION_IDENTIFIER);
INSTANCE = new BCStyle();
}
@Override
public ASN1ObjectIdentifier attrNameToOID(String str) {
return IETFUtils.decodeAttrName(str, this.defaultLookUp);
}
@Override
public ASN1Encodable encodeStringValue(ASN1ObjectIdentifier aSN1ObjectIdentifier, String str) {
if (!aSN1ObjectIdentifier.equals(EmailAddress) && !aSN1ObjectIdentifier.equals(DC)) {
if (aSN1ObjectIdentifier.equals(DATE_OF_BIRTH)) {
return new ASN1GeneralizedTime(str);
}
if (!aSN1ObjectIdentifier.equals(C) && !aSN1ObjectIdentifier.equals(SN) && !aSN1ObjectIdentifier.equals(DN_QUALIFIER) && !aSN1ObjectIdentifier.equals(TELEPHONE_NUMBER)) {
return super.encodeStringValue(aSN1ObjectIdentifier, str);
}
return new DERPrintableString(str);
}
return new DERIA5String(str);
}
@Override
public RDN[] fromString(String str) {
return IETFUtils.rDNsFromString(str, this);
}
@Override
public String[] oidToAttrNames(ASN1ObjectIdentifier aSN1ObjectIdentifier) {
return IETFUtils.findAttrNamesForOID(aSN1ObjectIdentifier, this.defaultLookUp);
}
@Override
public String oidToDisplayName(ASN1ObjectIdentifier aSN1ObjectIdentifier) {
return (String) DefaultSymbols.get(aSN1ObjectIdentifier);
}
@Override
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();
}
}