91 lines
2.5 KiB
Java
91 lines
2.5 KiB
Java
|
package org.bouncycastle.asn1.x509;
|
||
|
|
||
|
import org.bouncycastle.asn1.ASN1Integer;
|
||
|
import org.bouncycastle.asn1.ASN1Object;
|
||
|
import org.bouncycastle.asn1.ASN1Primitive;
|
||
|
import org.bouncycastle.asn1.ASN1Sequence;
|
||
|
import org.bouncycastle.asn1.ASN1TaggedObject;
|
||
|
import org.bouncycastle.asn1.DERBitString;
|
||
|
import org.bouncycastle.asn1.x500.X500Name;
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public class Certificate extends ASN1Object {
|
||
|
ASN1Sequence seq;
|
||
|
DERBitString sig;
|
||
|
AlgorithmIdentifier sigAlgId;
|
||
|
TBSCertificate tbsCert;
|
||
|
|
||
|
@Override // org.bouncycastle.asn1.ASN1Object, org.bouncycastle.asn1.ASN1Encodable
|
||
|
public ASN1Primitive toASN1Primitive() {
|
||
|
return this.seq;
|
||
|
}
|
||
|
|
||
|
public int getVersionNumber() {
|
||
|
return this.tbsCert.getVersionNumber();
|
||
|
}
|
||
|
|
||
|
public ASN1Integer getVersion() {
|
||
|
return this.tbsCert.getVersion();
|
||
|
}
|
||
|
|
||
|
public TBSCertificate getTBSCertificate() {
|
||
|
return this.tbsCert;
|
||
|
}
|
||
|
|
||
|
public SubjectPublicKeyInfo getSubjectPublicKeyInfo() {
|
||
|
return this.tbsCert.getSubjectPublicKeyInfo();
|
||
|
}
|
||
|
|
||
|
public X500Name getSubject() {
|
||
|
return this.tbsCert.getSubject();
|
||
|
}
|
||
|
|
||
|
public Time getStartDate() {
|
||
|
return this.tbsCert.getStartDate();
|
||
|
}
|
||
|
|
||
|
public AlgorithmIdentifier getSignatureAlgorithm() {
|
||
|
return this.sigAlgId;
|
||
|
}
|
||
|
|
||
|
public DERBitString getSignature() {
|
||
|
return this.sig;
|
||
|
}
|
||
|
|
||
|
public ASN1Integer getSerialNumber() {
|
||
|
return this.tbsCert.getSerialNumber();
|
||
|
}
|
||
|
|
||
|
public X500Name getIssuer() {
|
||
|
return this.tbsCert.getIssuer();
|
||
|
}
|
||
|
|
||
|
public Time getEndDate() {
|
||
|
return this.tbsCert.getEndDate();
|
||
|
}
|
||
|
|
||
|
public static Certificate getInstance(ASN1TaggedObject aSN1TaggedObject, boolean z) {
|
||
|
return getInstance(ASN1Sequence.getInstance(aSN1TaggedObject, z));
|
||
|
}
|
||
|
|
||
|
public static Certificate getInstance(Object obj) {
|
||
|
if (obj instanceof Certificate) {
|
||
|
return (Certificate) obj;
|
||
|
}
|
||
|
if (obj != null) {
|
||
|
return new Certificate(ASN1Sequence.getInstance(obj));
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
private Certificate(ASN1Sequence aSN1Sequence) {
|
||
|
this.seq = aSN1Sequence;
|
||
|
if (aSN1Sequence.size() != 3) {
|
||
|
throw new IllegalArgumentException("sequence wrong size for a certificate");
|
||
|
}
|
||
|
this.tbsCert = TBSCertificate.getInstance(aSN1Sequence.getObjectAt(0));
|
||
|
this.sigAlgId = AlgorithmIdentifier.getInstance(aSN1Sequence.getObjectAt(1));
|
||
|
this.sig = DERBitString.getInstance(aSN1Sequence.getObjectAt(2));
|
||
|
}
|
||
|
}
|