121 lines
3.5 KiB
Java
121 lines
3.5 KiB
Java
package org.jmrtd;
|
|
|
|
import com.airbnb.deeplinkdispatch.UrlTreeKt;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
|
|
/* loaded from: classes6.dex */
|
|
public class BACKey implements BACKeySpec {
|
|
static final boolean $assertionsDisabled = false;
|
|
private static final SimpleDateFormat SDF = new SimpleDateFormat("yyMMdd");
|
|
private static final long serialVersionUID = -1059774581180524710L;
|
|
private String dateOfBirth;
|
|
private String dateOfExpiry;
|
|
private String documentNumber;
|
|
|
|
public byte[] getEncoded() {
|
|
return null;
|
|
}
|
|
|
|
public String getFormat() {
|
|
return null;
|
|
}
|
|
|
|
protected BACKey() {
|
|
}
|
|
|
|
public BACKey(String str, String str2, String str3) {
|
|
if (str == null) {
|
|
throw new IllegalArgumentException("Illegal document number");
|
|
}
|
|
if (str2 == null || str2.length() != 6) {
|
|
throw new IllegalArgumentException("Illegal date: ".concat(String.valueOf(str2)));
|
|
}
|
|
if (str3 == null || str3.length() != 6) {
|
|
throw new IllegalArgumentException("Illegal date: ".concat(String.valueOf(str3)));
|
|
}
|
|
while (str.length() < 9) {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(str);
|
|
sb.append(UrlTreeKt.configurablePathSegmentPrefix);
|
|
str = sb.toString();
|
|
}
|
|
this.documentNumber = str.trim();
|
|
this.dateOfBirth = str2;
|
|
this.dateOfExpiry = str3;
|
|
}
|
|
|
|
public BACKey(String str, Date date, Date date2) {
|
|
this(str, toString(date), toString(date2));
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(this.documentNumber);
|
|
sb.append(", ");
|
|
sb.append(this.dateOfBirth);
|
|
sb.append(", ");
|
|
sb.append(this.dateOfExpiry);
|
|
return sb.toString();
|
|
}
|
|
|
|
public int hashCode() {
|
|
String str = this.documentNumber;
|
|
int hashCode = str == null ? 0 : str.hashCode();
|
|
String str2 = this.dateOfBirth;
|
|
int hashCode2 = str2 == null ? 0 : str2.hashCode();
|
|
String str3 = this.dateOfExpiry;
|
|
return ((((hashCode + 305) * 61) + hashCode2) * 61) + (str3 != null ? str3.hashCode() : 0);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (obj == null || !obj.getClass().equals(getClass())) {
|
|
return false;
|
|
}
|
|
if (obj == this) {
|
|
return true;
|
|
}
|
|
BACKey bACKey = (BACKey) obj;
|
|
return this.documentNumber.equals(bACKey.documentNumber) && this.dateOfBirth.equals(bACKey.dateOfBirth) && this.dateOfExpiry.equals(bACKey.dateOfExpiry);
|
|
}
|
|
|
|
private static String toString(Date date) {
|
|
String format;
|
|
synchronized (BACKey.class) {
|
|
format = SDF.format(date);
|
|
}
|
|
return format;
|
|
}
|
|
|
|
protected void setDocumentNumber(String str) {
|
|
this.documentNumber = str;
|
|
}
|
|
|
|
protected void setDateOfExpiry(String str) {
|
|
this.dateOfExpiry = str;
|
|
}
|
|
|
|
protected void setDateOfBirth(String str) {
|
|
this.dateOfBirth = str;
|
|
}
|
|
|
|
@Override // org.jmrtd.BACKeySpec
|
|
public String getDocumentNumber() {
|
|
return this.documentNumber;
|
|
}
|
|
|
|
@Override // org.jmrtd.BACKeySpec
|
|
public String getDateOfExpiry() {
|
|
return this.dateOfExpiry;
|
|
}
|
|
|
|
@Override // org.jmrtd.BACKeySpec
|
|
public String getDateOfBirth() {
|
|
return this.dateOfBirth;
|
|
}
|
|
|
|
public String getAlgorithm() {
|
|
return "BAC";
|
|
}
|
|
}
|