米多多 v3.0.1版本的 MD5 值为:f69e79dbe1787218a397ad907fb8f3ab
以下内容为反编译后的 X509Name.java 源代码,内容仅作参考
package org.eid_bc.bouncycastle.asn1.x509;
import androidx.core.content.FileProvider;
import c.i.v2;
import com.dtf.toyger.base.face.ToygerFaceService;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import org.eid_bc.bouncycastle.asn1.ASN1Encodable;
import org.eid_bc.bouncycastle.asn1.ASN1EncodableVector;
import org.eid_bc.bouncycastle.asn1.ASN1Encoding;
import org.eid_bc.bouncycastle.asn1.ASN1Object;
import org.eid_bc.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.eid_bc.bouncycastle.asn1.ASN1Primitive;
import org.eid_bc.bouncycastle.asn1.ASN1Sequence;
import org.eid_bc.bouncycastle.asn1.ASN1Set;
import org.eid_bc.bouncycastle.asn1.ASN1String;
import org.eid_bc.bouncycastle.asn1.ASN1TaggedObject;
import org.eid_bc.bouncycastle.asn1.DERSequence;
import org.eid_bc.bouncycastle.asn1.DERSet;
import org.eid_bc.bouncycastle.asn1.DERUniversalString;
import org.eid_bc.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
import org.eid_bc.bouncycastle.asn1.x500.X500Name;
import org.eid_bc.bouncycastle.util.Strings;
import org.eid_bc.bouncycastle.util.encoders.Hex;
public class X509Name extends ASN1Object {
public static final Hashtable DefaultLookUp;
public static final Boolean FALSE;
public static final Hashtable OIDLookUp;
public static final Hashtable SymbolLookUp;
public static final Boolean TRUE;
public Vector added;
public X509NameEntryConverter converter;
public int hashCodeValue;
public boolean isHashCodeCalculated;
public Vector ordering;
public ASN1Sequence seq;
public Vector values;
public static final ASN1ObjectIdentifier C = new ASN1ObjectIdentifier("2.5.4.6");
public static final ASN1ObjectIdentifier O = new ASN1ObjectIdentifier("2.5.4.10");
public static final ASN1ObjectIdentifier OU = new ASN1ObjectIdentifier("2.5.4.11");
public static final ASN1ObjectIdentifier T = new ASN1ObjectIdentifier("2.5.4.12");
public static final ASN1ObjectIdentifier CN = new ASN1ObjectIdentifier("2.5.4.3");
public static final ASN1ObjectIdentifier SN = new ASN1ObjectIdentifier("2.5.4.5");
public static final ASN1ObjectIdentifier STREET = new ASN1ObjectIdentifier("2.5.4.9");
public static final ASN1ObjectIdentifier SERIALNUMBER = SN;
public static final ASN1ObjectIdentifier L = new ASN1ObjectIdentifier("2.5.4.7");
public static final ASN1ObjectIdentifier ST = new ASN1ObjectIdentifier("2.5.4.8");
public static final ASN1ObjectIdentifier SURNAME = new ASN1ObjectIdentifier("2.5.4.4");
public static final ASN1ObjectIdentifier GIVENNAME = new ASN1ObjectIdentifier("2.5.4.42");
public static final ASN1ObjectIdentifier INITIALS = new ASN1ObjectIdentifier("2.5.4.43");
public static final ASN1ObjectIdentifier GENERATION = new ASN1ObjectIdentifier("2.5.4.44");
public static final ASN1ObjectIdentifier UNIQUE_IDENTIFIER = new ASN1ObjectIdentifier("2.5.4.45");
public static final ASN1ObjectIdentifier BUSINESS_CATEGORY = new ASN1ObjectIdentifier("2.5.4.15");
public static final ASN1ObjectIdentifier POSTAL_CODE = new ASN1ObjectIdentifier("2.5.4.17");
public static final ASN1ObjectIdentifier DN_QUALIFIER = new ASN1ObjectIdentifier("2.5.4.46");
public static final ASN1ObjectIdentifier PSEUDONYM = new ASN1ObjectIdentifier("2.5.4.65");
public static final ASN1ObjectIdentifier DATE_OF_BIRTH = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.1");
public static final ASN1ObjectIdentifier PLACE_OF_BIRTH = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.2");
public static final ASN1ObjectIdentifier GENDER = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.3");
public static final ASN1ObjectIdentifier COUNTRY_OF_CITIZENSHIP = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.4");
public static final ASN1ObjectIdentifier COUNTRY_OF_RESIDENCE = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.9.5");
public static final ASN1ObjectIdentifier NAME_AT_BIRTH = new ASN1ObjectIdentifier("1.3.36.8.3.14");
public static final ASN1ObjectIdentifier POSTAL_ADDRESS = new ASN1ObjectIdentifier("2.5.4.16");
public static final ASN1ObjectIdentifier TELEPHONE_NUMBER = X509ObjectIdentifiers.id_at_telephoneNumber;
public static final ASN1ObjectIdentifier NAME = X509ObjectIdentifiers.id_at_name;
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 boolean DefaultReverse = false;
public static final Hashtable DefaultSymbols = new Hashtable();
public static final Hashtable RFC2253Symbols = new Hashtable();
public static final Hashtable RFC1779Symbols = new Hashtable();
static {
Hashtable hashtable = new Hashtable();
DefaultLookUp = hashtable;
OIDLookUp = DefaultSymbols;
SymbolLookUp = hashtable;
TRUE = new Boolean(true);
FALSE = new Boolean(false);
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");
RFC2253Symbols.put(C, "C");
RFC2253Symbols.put(O, "O");
RFC2253Symbols.put(OU, "OU");
RFC2253Symbols.put(CN, "CN");
RFC2253Symbols.put(L, "L");
RFC2253Symbols.put(ST, "ST");
RFC2253Symbols.put(STREET, "STREET");
RFC2253Symbols.put(DC, "DC");
RFC2253Symbols.put(UID, "UID");
RFC1779Symbols.put(C, "C");
RFC1779Symbols.put(O, "O");
RFC1779Symbols.put(OU, "OU");
RFC1779Symbols.put(CN, "CN");
RFC1779Symbols.put(L, "L");
RFC1779Symbols.put(ST, "ST");
RFC1779Symbols.put(STREET, "STREET");
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);
}
public X509Name() {
this.converter = null;
this.ordering = new Vector();
this.values = new Vector();
this.added = new Vector();
}
private void addEntry(Hashtable hashtable, String str, Boolean bool) {
X509NameTokenizer x509NameTokenizer = new X509NameTokenizer(str, '=');
String nextToken = x509NameTokenizer.nextToken();
if (x509NameTokenizer.hasMoreTokens()) {
String nextToken2 = x509NameTokenizer.nextToken();
this.ordering.addElement(decodeOID(nextToken, hashtable));
this.values.addElement(unescape(nextToken2));
this.added.addElement(bool);
return;
}
throw new IllegalArgumentException("badly formatted directory string");
}
private void appendValue(StringBuffer stringBuffer, Hashtable hashtable, ASN1ObjectIdentifier aSN1ObjectIdentifier, String str) {
String str2 = (String) hashtable.get(aSN1ObjectIdentifier);
if (str2 != null) {
stringBuffer.append(str2);
} else {
stringBuffer.append(aSN1ObjectIdentifier.getId());
}
stringBuffer.append('=');
int length = stringBuffer.length();
stringBuffer.append(str);
int length2 = stringBuffer.length();
if (str.length() >= 2 && str.charAt(0) == '\\' && str.charAt(1) == '#') {
length += 2;
}
while (length < length2 && stringBuffer.charAt(length) == ' ') {
stringBuffer.insert(length, "\\");
length += 2;
length2++;
}
while (true) {
length2--;
if (length2 <= length || stringBuffer.charAt(length2) != ' ') {
break;
}
stringBuffer.insert(length2, '\\');
}
while (length <= length2) {
char charAt = stringBuffer.charAt(length);
if (charAt != '\"' && charAt != '\\' && charAt != '+' && charAt != ',') {
switch (charAt) {
case ';':
case '<':
case '=':
case '>':
break;
default:
length++;
continue;
}
}
stringBuffer.insert(length, "\\");
length += 2;
length2++;
}
}
private String bytesToString(byte[] bArr) {
int length = bArr.length;
char[] cArr = new char[length];
for (int i2 = 0; i2 != length; i2++) {
cArr[i2] = (char) (bArr[i2] & 255);
}
return new String(cArr);
}
private String canonicalize(String str) {
String lowerCase = Strings.toLowerCase(str.trim());
if (lowerCase.length() <= 0 || lowerCase.charAt(0) != '#') {
return lowerCase;
}
ASN1Primitive decodeObject = decodeObject(lowerCase);
return decodeObject instanceof ASN1String ? Strings.toLowerCase(((ASN1String) decodeObject).getString().trim()) : lowerCase;
}
private ASN1ObjectIdentifier decodeOID(String str, Hashtable hashtable) {
String trim = str.trim();
if (Strings.toUpperCase(trim).startsWith("OID.")) {
return new ASN1ObjectIdentifier(trim.substring(4));
}
if (trim.charAt(0) >= '0' && trim.charAt(0) <= '9') {
return new ASN1ObjectIdentifier(trim);
}
ASN1ObjectIdentifier aSN1ObjectIdentifier = (ASN1ObjectIdentifier) hashtable.get(Strings.toLowerCase(trim));
if (aSN1ObjectIdentifier != null) {
return aSN1ObjectIdentifier;
}
throw new IllegalArgumentException("Unknown object id - " + trim + " - passed to distinguished name");
}
private ASN1Primitive decodeObject(String str) {
try {
return ASN1Primitive.fromByteArray(Hex.decode(str.substring(1)));
} catch (IOException e2) {
throw new IllegalStateException("unknown encoding in name: " + e2);
}
}
private boolean equivalentStrings(String str, String str2) {
String canonicalize = canonicalize(str);
String canonicalize2 = canonicalize(str2);
return canonicalize.equals(canonicalize2) || stripInternalSpaces(canonicalize).equals(stripInternalSpaces(canonicalize2));
}
public static X509Name getInstance(ASN1TaggedObject aSN1TaggedObject, boolean z) {
return getInstance(ASN1Sequence.getInstance(aSN1TaggedObject, z));
}
private String stripInternalSpaces(String str) {
StringBuffer stringBuffer = new StringBuffer();
if (str.length() != 0) {
char charAt = str.charAt(0);
stringBuffer.append(charAt);
int i2 = 1;
while (i2 < str.length()) {
char charAt2 = str.charAt(i2);
if (charAt != ' ' || charAt2 != ' ') {
stringBuffer.append(charAt2);
}
i2++;
charAt = charAt2;
}
}
return stringBuffer.toString();
}
private String unescape(String str) {
int i2;
if (str.length() != 0 && (str.indexOf(92) >= 0 || str.indexOf(34) >= 0)) {
char[] charArray = str.toCharArray();
StringBuffer stringBuffer = new StringBuffer(str.length());
if (charArray[0] == '\\' && charArray[1] == '#') {
i2 = 2;
stringBuffer.append("\\#");
} else {
i2 = 0;
}
boolean z = false;
int i3 = 0;
boolean z2 = false;
boolean z3 = false;
while (i2 != charArray.length) {
char c2 = charArray[i2];
if (c2 != ' ') {
z3 = true;
}
if (c2 != '\"') {
if (c2 == '\\' && !z && !z2) {
i3 = stringBuffer.length();
z = true;
} else if (c2 != ' ' || z || z3) {
stringBuffer.append(c2);
}
i2++;
} else if (z) {
stringBuffer.append(c2);
} else {
z2 = !z2;
}
z = false;
i2++;
}
if (stringBuffer.length() > 0) {
while (stringBuffer.charAt(stringBuffer.length() - 1) == ' ' && i3 != stringBuffer.length() - 1) {
stringBuffer.setLength(stringBuffer.length() - 1);
}
}
return stringBuffer.toString();
}
return str.trim();
}
public boolean equals(Object obj, boolean z) {
if (z) {
if (obj == this) {
return true;
}
if ((obj instanceof X509Name) || (obj instanceof ASN1Sequence)) {
if (toASN1Primitive().equals(((ASN1Encodable) obj).toASN1Primitive())) {
return true;
}
try {
X509Name x509Name = getInstance(obj);
int size = this.ordering.size();
if (size != x509Name.ordering.size()) {
return false;
}
for (int i2 = 0; i2 < size; i2++) {
if (!((ASN1ObjectIdentifier) this.ordering.elementAt(i2)).equals((ASN1ObjectIdentifier) x509Name.ordering.elementAt(i2)) || !equivalentStrings((String) this.values.elementAt(i2), (String) x509Name.values.elementAt(i2))) {
return false;
}
}
return true;
} catch (IllegalArgumentException unused) {
return false;
}
}
return false;
}
return equals(obj);
}
public Vector getOIDs() {
Vector vector = new Vector();
for (int i2 = 0; i2 != this.ordering.size(); i2++) {
vector.addElement(this.ordering.elementAt(i2));
}
return vector;
}
public Vector getValues() {
Vector vector = new Vector();
for (int i2 = 0; i2 != this.values.size(); i2++) {
vector.addElement(this.values.elementAt(i2));
}
return vector;
}
@Override
public int hashCode() {
if (this.isHashCodeCalculated) {
return this.hashCodeValue;
}
this.isHashCodeCalculated = true;
for (int i2 = 0; i2 != this.ordering.size(); i2++) {
String stripInternalSpaces = stripInternalSpaces(canonicalize((String) this.values.elementAt(i2)));
int hashCode = this.hashCodeValue ^ this.ordering.elementAt(i2).hashCode();
this.hashCodeValue = hashCode;
this.hashCodeValue = stripInternalSpaces.hashCode() ^ hashCode;
}
return this.hashCodeValue;
}
@Override
public ASN1Primitive toASN1Primitive() {
if (this.seq == null) {
ASN1EncodableVector aSN1EncodableVector = new ASN1EncodableVector();
ASN1EncodableVector aSN1EncodableVector2 = new ASN1EncodableVector();
ASN1ObjectIdentifier aSN1ObjectIdentifier = null;
int i2 = 0;
while (i2 != this.ordering.size()) {
ASN1EncodableVector aSN1EncodableVector3 = new ASN1EncodableVector();
ASN1ObjectIdentifier aSN1ObjectIdentifier2 = (ASN1ObjectIdentifier) this.ordering.elementAt(i2);
aSN1EncodableVector3.add(aSN1ObjectIdentifier2);
aSN1EncodableVector3.add(this.converter.getConvertedValue(aSN1ObjectIdentifier2, (String) this.values.elementAt(i2)));
if (aSN1ObjectIdentifier != null && !((Boolean) this.added.elementAt(i2)).booleanValue()) {
aSN1EncodableVector.add(new DERSet(aSN1EncodableVector2));
aSN1EncodableVector2 = new ASN1EncodableVector();
aSN1EncodableVector2.add(new DERSequence(aSN1EncodableVector3));
} else {
aSN1EncodableVector2.add(new DERSequence(aSN1EncodableVector3));
}
i2++;
aSN1ObjectIdentifier = aSN1ObjectIdentifier2;
}
aSN1EncodableVector.add(new DERSet(aSN1EncodableVector2));
this.seq = new DERSequence(aSN1EncodableVector);
}
return this.seq;
}
public String toString(boolean z, Hashtable hashtable) {
StringBuffer stringBuffer = new StringBuffer();
Vector vector = new Vector();
StringBuffer stringBuffer2 = null;
for (int i2 = 0; i2 < this.ordering.size(); i2++) {
if (((Boolean) this.added.elementAt(i2)).booleanValue()) {
stringBuffer2.append('+');
appendValue(stringBuffer2, hashtable, (ASN1ObjectIdentifier) this.ordering.elementAt(i2), (String) this.values.elementAt(i2));
} else {
stringBuffer2 = new StringBuffer();
appendValue(stringBuffer2, hashtable, (ASN1ObjectIdentifier) this.ordering.elementAt(i2), (String) this.values.elementAt(i2));
vector.addElement(stringBuffer2);
}
}
boolean z2 = true;
if (z) {
for (int size = vector.size() - 1; size >= 0; size--) {
if (z2) {
z2 = false;
} else {
stringBuffer.append(',');
}
stringBuffer.append(vector.elementAt(size).toString());
}
} else {
for (int i3 = 0; i3 < vector.size(); i3++) {
if (z2) {
z2 = false;
} else {
stringBuffer.append(',');
}
stringBuffer.append(vector.elementAt(i3).toString());
}
}
return stringBuffer.toString();
}
public static X509Name getInstance(Object obj) {
if (obj != null && !(obj instanceof X509Name)) {
if (obj instanceof X500Name) {
return new X509Name(ASN1Sequence.getInstance(((X500Name) obj).toASN1Primitive()));
}
if (obj != null) {
return new X509Name(ASN1Sequence.getInstance(obj));
}
return null;
}
return (X509Name) obj;
}
public Vector getValues(ASN1ObjectIdentifier aSN1ObjectIdentifier) {
Vector vector = new Vector();
for (int i2 = 0; i2 != this.values.size(); i2++) {
if (this.ordering.elementAt(i2).equals(aSN1ObjectIdentifier)) {
String str = (String) this.values.elementAt(i2);
if (str.length() > 2 && str.charAt(0) == '\\' && str.charAt(1) == '#') {
vector.addElement(str.substring(1));
} else {
vector.addElement(str);
}
}
}
return vector;
}
public X509Name(ASN1Sequence aSN1Sequence) {
this.converter = null;
this.ordering = new Vector();
this.values = new Vector();
this.added = new Vector();
this.seq = aSN1Sequence;
Enumeration objects = aSN1Sequence.getObjects();
while (objects.hasMoreElements()) {
ASN1Set aSN1Set = ASN1Set.getInstance(((ASN1Encodable) objects.nextElement()).toASN1Primitive());
int i2 = 0;
while (i2 < aSN1Set.size()) {
ASN1Sequence aSN1Sequence2 = ASN1Sequence.getInstance(aSN1Set.getObjectAt(i2).toASN1Primitive());
if (aSN1Sequence2.size() == 2) {
this.ordering.addElement(ASN1ObjectIdentifier.getInstance(aSN1Sequence2.getObjectAt(0)));
ASN1Encodable objectAt = aSN1Sequence2.getObjectAt(1);
if ((objectAt instanceof ASN1String) && !(objectAt instanceof DERUniversalString)) {
String string = ((ASN1String) objectAt).getString();
if (string.length() > 0 && string.charAt(0) == '#') {
Vector vector = this.values;
vector.addElement("\\" + string);
} else {
this.values.addElement(string);
}
} else {
try {
Vector vector2 = this.values;
vector2.addElement("#" + bytesToString(Hex.encode(objectAt.toASN1Primitive().getEncoded(ASN1Encoding.DER))));
} catch (IOException unused) {
throw new IllegalArgumentException("cannot encode value");
}
}
this.added.addElement(i2 != 0 ? TRUE : FALSE);
i2++;
} else {
throw new IllegalArgumentException("badly sized pair");
}
}
}
}
@Override
public boolean equals(Object obj) {
int i2;
int i3;
boolean z;
if (obj == this) {
return true;
}
if ((obj instanceof X509Name) || (obj instanceof ASN1Sequence)) {
if (toASN1Primitive().equals(((ASN1Encodable) obj).toASN1Primitive())) {
return true;
}
try {
X509Name x509Name = getInstance(obj);
int size = this.ordering.size();
if (size != x509Name.ordering.size()) {
return false;
}
boolean[] zArr = new boolean[size];
int i4 = -1;
if (this.ordering.elementAt(0).equals(x509Name.ordering.elementAt(0))) {
i4 = size;
i2 = 0;
i3 = 1;
} else {
i2 = size - 1;
i3 = -1;
}
while (i2 != i4) {
ASN1ObjectIdentifier aSN1ObjectIdentifier = (ASN1ObjectIdentifier) this.ordering.elementAt(i2);
String str = (String) this.values.elementAt(i2);
int i5 = 0;
while (true) {
if (i5 >= size) {
z = false;
break;
} else if (!zArr[i5] && aSN1ObjectIdentifier.equals((ASN1ObjectIdentifier) x509Name.ordering.elementAt(i5)) && equivalentStrings(str, (String) x509Name.values.elementAt(i5))) {
zArr[i5] = true;
z = true;
break;
} else {
i5++;
}
}
if (!z) {
return false;
}
i2 += i3;
}
return true;
} catch (IllegalArgumentException unused) {
return false;
}
}
return false;
}
public String toString() {
return toString(DefaultReverse, DefaultSymbols);
}
public X509Name(Hashtable hashtable) {
this((Vector) null, hashtable);
}
public X509Name(Vector vector, Hashtable hashtable) {
this(vector, hashtable, new X509DefaultEntryConverter());
}
public X509Name(Vector vector, Hashtable hashtable, X509NameEntryConverter x509NameEntryConverter) {
this.converter = null;
this.ordering = new Vector();
this.values = new Vector();
this.added = new Vector();
this.converter = x509NameEntryConverter;
if (vector != null) {
for (int i2 = 0; i2 != vector.size(); i2++) {
this.ordering.addElement(vector.elementAt(i2));
this.added.addElement(FALSE);
}
} else {
Enumeration keys = hashtable.keys();
while (keys.hasMoreElements()) {
this.ordering.addElement(keys.nextElement());
this.added.addElement(FALSE);
}
}
for (int i3 = 0; i3 != this.ordering.size(); i3++) {
ASN1ObjectIdentifier aSN1ObjectIdentifier = (ASN1ObjectIdentifier) this.ordering.elementAt(i3);
if (hashtable.get(aSN1ObjectIdentifier) != null) {
this.values.addElement(hashtable.get(aSN1ObjectIdentifier));
} else {
throw new IllegalArgumentException("No attribute for object id - " + aSN1ObjectIdentifier.getId() + " - passed to distinguished name");
}
}
}
public X509Name(Vector vector, Vector vector2) {
this(vector, vector2, new X509DefaultEntryConverter());
}
public X509Name(Vector vector, Vector vector2, X509NameEntryConverter x509NameEntryConverter) {
this.converter = null;
this.ordering = new Vector();
this.values = new Vector();
this.added = new Vector();
this.converter = x509NameEntryConverter;
if (vector.size() == vector2.size()) {
for (int i2 = 0; i2 < vector.size(); i2++) {
this.ordering.addElement(vector.elementAt(i2));
this.values.addElement(vector2.elementAt(i2));
this.added.addElement(FALSE);
}
return;
}
throw new IllegalArgumentException("oids vector must be same length as values.");
}
public X509Name(String str) {
this(DefaultReverse, DefaultLookUp, str);
}
public X509Name(String str, X509NameEntryConverter x509NameEntryConverter) {
this(DefaultReverse, DefaultLookUp, str, x509NameEntryConverter);
}
public X509Name(boolean z, String str) {
this(z, DefaultLookUp, str);
}
public X509Name(boolean z, String str, X509NameEntryConverter x509NameEntryConverter) {
this(z, DefaultLookUp, str, x509NameEntryConverter);
}
public X509Name(boolean z, Hashtable hashtable, String str) {
this(z, hashtable, str, new X509DefaultEntryConverter());
}
public X509Name(boolean z, Hashtable hashtable, String str, X509NameEntryConverter x509NameEntryConverter) {
this.converter = null;
this.ordering = new Vector();
this.values = new Vector();
this.added = new Vector();
this.converter = x509NameEntryConverter;
X509NameTokenizer x509NameTokenizer = new X509NameTokenizer(str);
while (x509NameTokenizer.hasMoreTokens()) {
String nextToken = x509NameTokenizer.nextToken();
if (nextToken.indexOf(43) > 0) {
X509NameTokenizer x509NameTokenizer2 = new X509NameTokenizer(nextToken, '+');
addEntry(hashtable, x509NameTokenizer2.nextToken(), FALSE);
while (x509NameTokenizer2.hasMoreTokens()) {
addEntry(hashtable, x509NameTokenizer2.nextToken(), TRUE);
}
} else {
addEntry(hashtable, nextToken, FALSE);
}
}
if (z) {
Vector vector = new Vector();
Vector vector2 = new Vector();
Vector vector3 = new Vector();
int i2 = 1;
for (int i3 = 0; i3 < this.ordering.size(); i3++) {
if (((Boolean) this.added.elementAt(i3)).booleanValue()) {
vector.insertElementAt(this.ordering.elementAt(i3), i2);
vector2.insertElementAt(this.values.elementAt(i3), i2);
vector3.insertElementAt(this.added.elementAt(i3), i2);
i2++;
} else {
vector.insertElementAt(this.ordering.elementAt(i3), 0);
vector2.insertElementAt(this.values.elementAt(i3), 0);
vector3.insertElementAt(this.added.elementAt(i3), 0);
i2 = 1;
}
}
this.ordering = vector;
this.values = vector2;
this.added = vector3;
}
}
}