225 lines
5.8 KiB
C#
225 lines
5.8 KiB
C#
using System;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509
|
|
{
|
|
// Token: 0x020018F9 RID: 6393
|
|
[Token(Token = "0x20018F9")]
|
|
public class AttributeCertificateIssuer : IX509Selector, ICloneable
|
|
{
|
|
// Token: 0x0600966F RID: 38511 RVA: 0x001EF458 File Offset: 0x001ED658
|
|
[Token(Token = "0x600966F")]
|
|
[Address(RVA = "0x1623DD0", Offset = "0x1622BD0", VA = "0x181623DD0")]
|
|
public AttributeCertificateIssuer(AttCertIssuer issuer)
|
|
{
|
|
Asn1Encodable obj = issuer.obj;
|
|
this.form = obj;
|
|
}
|
|
|
|
// Token: 0x06009670 RID: 38512 RVA: 0x001EF480 File Offset: 0x001ED680
|
|
[Token(Token = "0x6009670")]
|
|
[Address(RVA = "0x1623D20", Offset = "0x1622B20", VA = "0x181623D20")]
|
|
public AttributeCertificateIssuer(X509Name principal)
|
|
{
|
|
V2Form v2Form = new V2Form(new GeneralNames(new GeneralName(principal)));
|
|
this.form = v2Form;
|
|
}
|
|
|
|
// Token: 0x06009671 RID: 38513 RVA: 0x001EF4AC File Offset: 0x001ED6AC
|
|
[Token(Token = "0x6009671")]
|
|
[Address(RVA = "0x1623420", Offset = "0x1622220", VA = "0x181623420")]
|
|
private object[] GetNames()
|
|
{
|
|
Asn1Encodable asn1Encodable;
|
|
int num;
|
|
do
|
|
{
|
|
asn1Encodable = this.form;
|
|
num = 0;
|
|
}
|
|
while ((asn1Encodable != 0 && asn1Encodable != 0 && (asn1Encodable == 0 || asn1Encodable == 0)) || asn1Encodable == 0);
|
|
GeneralName[] array;
|
|
int length = array.Length;
|
|
if (num != length)
|
|
{
|
|
GeneralName generalName = array[num];
|
|
num++;
|
|
}
|
|
object[] array2 = new object[num];
|
|
int length2 = array.Length;
|
|
if (num != length2)
|
|
{
|
|
GeneralName generalName2 = array[num];
|
|
if (generalName2.tag == 4)
|
|
{
|
|
num++;
|
|
X509Name instance = X509Name.GetInstance(generalName2.obj);
|
|
throw new ArrayTypeMismatchException();
|
|
}
|
|
num++;
|
|
}
|
|
return array2;
|
|
}
|
|
|
|
// Token: 0x06009672 RID: 38514 RVA: 0x001EF554 File Offset: 0x001ED754
|
|
[Token(Token = "0x6009672")]
|
|
[Address(RVA = "0x16236E0", Offset = "0x16224E0", VA = "0x1816236E0")]
|
|
public X509Name[] GetPrincipals()
|
|
{
|
|
object[] names = this.GetNames();
|
|
int num = 0;
|
|
int num2 = 0;
|
|
int num3 = 0;
|
|
int length = names.Length;
|
|
if (num3 != length)
|
|
{
|
|
if (names[num2] == 0)
|
|
{
|
|
}
|
|
num2++;
|
|
}
|
|
X509Name[] array = new X509Name[num];
|
|
int num4 = 0;
|
|
int num5 = 0;
|
|
int num6 = 0;
|
|
int length2 = names.Length;
|
|
if (num6 != length2)
|
|
{
|
|
object obj = names[num5];
|
|
if (obj != 0 && obj != 0)
|
|
{
|
|
num4++;
|
|
throw new ArrayTypeMismatchException();
|
|
}
|
|
num5++;
|
|
}
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x06009673 RID: 38515 RVA: 0x001EF5E8 File Offset: 0x001ED7E8
|
|
[Token(Token = "0x6009673")]
|
|
[Address(RVA = "0x1623BD0", Offset = "0x16229D0", VA = "0x181623BD0")]
|
|
private bool MatchesDN(X509Name subject, GeneralNames targets)
|
|
{
|
|
GeneralName[] names = targets.GetNames();
|
|
int num = 0;
|
|
int length = names.Length;
|
|
if (num != length)
|
|
{
|
|
GeneralName generalName = names[num];
|
|
if (generalName.tag == 4)
|
|
{
|
|
if (!X509Name.GetInstance(generalName.obj).Equivalent(subject))
|
|
{
|
|
}
|
|
return true;
|
|
}
|
|
num++;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009674 RID: 38516 RVA: 0x001EF63C File Offset: 0x001ED83C
|
|
[Token(Token = "0x6009674")]
|
|
[Address(RVA = "0x16232A0", Offset = "0x16220A0", VA = "0x1816232A0", Slot = "5")]
|
|
public object Clone()
|
|
{
|
|
Asn1Encodable obj = AttCertIssuer.GetInstance(this.form).obj;
|
|
AttributeCertificateIssuer attributeCertificateIssuer;
|
|
attributeCertificateIssuer.form = obj;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009675 RID: 38517 RVA: 0x001EF668 File Offset: 0x001ED868
|
|
[Token(Token = "0x6009675")]
|
|
[Address(RVA = "0x16238D0", Offset = "0x16226D0", VA = "0x1816238D0")]
|
|
public bool Match(X509Certificate x509Cert)
|
|
{
|
|
for (;;)
|
|
{
|
|
Asn1Encodable asn1Encodable = this.form;
|
|
if (asn1Encodable != 0 && asn1Encodable != 0)
|
|
{
|
|
int num = 0;
|
|
if (asn1Encodable == 0)
|
|
{
|
|
continue;
|
|
}
|
|
if (num == 0)
|
|
{
|
|
break;
|
|
}
|
|
if (x509Cert.Version == 0)
|
|
{
|
|
}
|
|
BigInteger serialNumber = x509Cert.SerialNumber;
|
|
}
|
|
X509Name issuerDN = x509Cert.IssuerDN;
|
|
Asn1Encodable asn1Encodable2 = this.form;
|
|
if (asn1Encodable2 == 0 || asn1Encodable2 != 0)
|
|
{
|
|
goto IL_53;
|
|
}
|
|
}
|
|
X509Name issuerDN2 = x509Cert.IssuerDN;
|
|
bool flag;
|
|
return flag;
|
|
IL_53:
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009676 RID: 38518 RVA: 0x001EF6D0 File Offset: 0x001ED8D0
|
|
[Token(Token = "0x6009676")]
|
|
[Address(RVA = "0x1623310", Offset = "0x1622110", VA = "0x181623310", Slot = "0")]
|
|
public override bool Equals(object obj)
|
|
{
|
|
while (obj != this)
|
|
{
|
|
if (obj != 0 && obj != 0)
|
|
{
|
|
if (obj == 0)
|
|
{
|
|
continue;
|
|
}
|
|
Asn1Object asn1Object = this.form.ToAsn1Object();
|
|
}
|
|
break;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
// Token: 0x06009677 RID: 38519 RVA: 0x001EF708 File Offset: 0x001ED908
|
|
[Token(Token = "0x6009677")]
|
|
[Address(RVA = "0x4DA700", Offset = "0x4D9500", VA = "0x1804DA700", Slot = "2")]
|
|
public override int GetHashCode()
|
|
{
|
|
Asn1Object asn1Object = this.form.ToAsn1Object();
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009678 RID: 38520 RVA: 0x001EF728 File Offset: 0x001ED928
|
|
[Token(Token = "0x6009678")]
|
|
[Address(RVA = "0x1623AF0", Offset = "0x16228F0", VA = "0x181623AF0", Slot = "4")]
|
|
public bool Match(object obj)
|
|
{
|
|
while (obj != 0 && obj != 0)
|
|
{
|
|
if (obj != 0)
|
|
{
|
|
bool flag;
|
|
return flag;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x04006677 RID: 26231
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006677")]
|
|
internal readonly Asn1Encodable form;
|
|
}
|
|
}
|