720 lines
31 KiB
C#
720 lines
31 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.IO;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Misc;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Utilities;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509
|
|
{
|
|
// Token: 0x020019E2 RID: 6626
|
|
[Token(Token = "0x20019E2")]
|
|
public class X509Certificate : X509ExtensionBase
|
|
{
|
|
// Token: 0x06009A7A RID: 39546 RVA: 0x001F921C File Offset: 0x001F741C
|
|
[Token(Token = "0x6009A7A")]
|
|
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
|
|
protected X509Certificate()
|
|
{
|
|
}
|
|
|
|
// Token: 0x06009A7B RID: 39547 RVA: 0x001F9230 File Offset: 0x001F7430
|
|
[Token(Token = "0x6009A7B")]
|
|
[Address(RVA = "0x41A730", Offset = "0x419730", VA = "0x18041A730")]
|
|
public X509Certificate(X509CertificateStructure c)
|
|
{
|
|
this.c = c;
|
|
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier("2.5.29.19");
|
|
if (this.GetCriticalExtensionOids() != 0)
|
|
{
|
|
Asn1Object asn1Object;
|
|
BasicConstraints instance = BasicConstraints.GetInstance(asn1Object);
|
|
this.basicConstraints = instance;
|
|
}
|
|
DerObjectIdentifier derObjectIdentifier2 = new DerObjectIdentifier("2.5.29.15");
|
|
if (this.GetCriticalExtensionOids() == 0)
|
|
{
|
|
int num = 0;
|
|
this.keyUsage = num;
|
|
}
|
|
Asn1Object asn1Object2;
|
|
DerBitString instance2 = DerBitString.GetInstance(asn1Object2);
|
|
byte[] octets = instance2.GetOctets();
|
|
byte[] bytes = instance2.GetBytes();
|
|
int num2 = octets.Length;
|
|
num2 -= bytes;
|
|
bool[] array = new bool[9];
|
|
this.keyUsage = array;
|
|
int num3 = 0;
|
|
while (num3 == num2)
|
|
{
|
|
}
|
|
bool[] array2 = this.keyUsage;
|
|
uint num4;
|
|
num3 += (int)num4;
|
|
num3 -= (int)num4;
|
|
num3++;
|
|
}
|
|
|
|
// Token: 0x1700189E RID: 6302
|
|
// (get) Token: 0x06009A7C RID: 39548 RVA: 0x001F9320 File Offset: 0x001F7520
|
|
[Token(Token = "0x1700189E")]
|
|
public virtual X509CertificateStructure CertificateStructure
|
|
{
|
|
[Token(Token = "0x6009A7C")]
|
|
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530", Slot = "13")]
|
|
get
|
|
{
|
|
return this.c;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700189F RID: 6303
|
|
// (get) Token: 0x06009A7D RID: 39549 RVA: 0x001F9334 File Offset: 0x001F7534
|
|
[Token(Token = "0x1700189F")]
|
|
public virtual bool IsValidNow
|
|
{
|
|
[Token(Token = "0x6009A7D")]
|
|
[Address(RVA = "0x41AA10", Offset = "0x419A10", VA = "0x18041AA10", Slot = "14")]
|
|
get
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009A7D)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean BestHTTP.SecureProtocol.Org.BouncyCastle.X509.X509Certificate::get_IsValidNow()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:DateTime(var_1_07, callgetter:DateTime(DateTime::get_UtcNow))
|
|
stloc:ISet(var_2_0E, call:ISet(IX509Extension::GetCriticalExtensionOids, ldloc:X509Certificate[exp:IX509Extension](this)))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009A7E RID: 39550 RVA: 0x001F9350 File Offset: 0x001F7550
|
|
[Token(Token = "0x6009A7E")]
|
|
[Address(RVA = "0x4199E0", Offset = "0x4189E0", VA = "0x1804199E0", Slot = "15")]
|
|
public virtual bool IsValid(DateTime time)
|
|
{
|
|
X509Name subjectDN = this.SubjectDN;
|
|
DateTime notBefore = this.NotBefore;
|
|
int num;
|
|
return num <= 0;
|
|
}
|
|
|
|
// Token: 0x06009A7F RID: 39551 RVA: 0x001F9378 File Offset: 0x001F7578
|
|
[Token(Token = "0x6009A7F")]
|
|
[Address(RVA = "0x418CC0", Offset = "0x417CC0", VA = "0x180418CC0", Slot = "16")]
|
|
public virtual void CheckValidity()
|
|
{
|
|
DateTime utcNow = DateTime.UtcNow;
|
|
ISet criticalExtensionOids = ((IX509Extension)this).GetCriticalExtensionOids();
|
|
}
|
|
|
|
// Token: 0x06009A80 RID: 39552 RVA: 0x001F9394 File Offset: 0x001F7594
|
|
[Token(Token = "0x6009A80")]
|
|
[Address(RVA = "0x418D30", Offset = "0x417D30", VA = "0x180418D30", Slot = "17")]
|
|
public virtual void CheckValidity(DateTime time)
|
|
{
|
|
DateTime notBefore = this.NotBefore;
|
|
X509Name subjectDN = this.SubjectDN;
|
|
}
|
|
|
|
// Token: 0x170018A0 RID: 6304
|
|
// (get) Token: 0x06009A81 RID: 39553 RVA: 0x001F93D0 File Offset: 0x001F75D0
|
|
[Token(Token = "0x170018A0")]
|
|
public virtual int Version
|
|
{
|
|
[Token(Token = "0x6009A81")]
|
|
[Address(RVA = "0x41AC70", Offset = "0x419C70", VA = "0x18041AC70", Slot = "18")]
|
|
get
|
|
{
|
|
return this.c.Version;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170018A1 RID: 6305
|
|
// (get) Token: 0x06009A82 RID: 39554 RVA: 0x001F93F0 File Offset: 0x001F75F0
|
|
[Token(Token = "0x170018A1")]
|
|
public virtual BigInteger SerialNumber
|
|
{
|
|
[Token(Token = "0x6009A82")]
|
|
[Address(RVA = "0x41AB30", Offset = "0x419B30", VA = "0x18041AB30", Slot = "19")]
|
|
get
|
|
{
|
|
return this.c.SerialNumber.Value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170018A2 RID: 6306
|
|
// (get) Token: 0x06009A83 RID: 39555 RVA: 0x001F9414 File Offset: 0x001F7614
|
|
[Token(Token = "0x170018A2")]
|
|
public virtual X509Name IssuerDN
|
|
{
|
|
[Token(Token = "0x6009A83")]
|
|
[Address(RVA = "0x41AA80", Offset = "0x419A80", VA = "0x18041AA80", Slot = "20")]
|
|
get
|
|
{
|
|
return this.c.Issuer;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170018A3 RID: 6307
|
|
// (get) Token: 0x06009A84 RID: 39556 RVA: 0x001F9434 File Offset: 0x001F7634
|
|
[Token(Token = "0x170018A3")]
|
|
public virtual X509Name SubjectDN
|
|
{
|
|
[Token(Token = "0x6009A84")]
|
|
[Address(RVA = "0x41AC20", Offset = "0x419C20", VA = "0x18041AC20", Slot = "21")]
|
|
get
|
|
{
|
|
return this.c.Subject;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170018A4 RID: 6308
|
|
// (get) Token: 0x06009A85 RID: 39557 RVA: 0x001F9454 File Offset: 0x001F7654
|
|
[Token(Token = "0x170018A4")]
|
|
public virtual DateTime NotBefore
|
|
{
|
|
[Token(Token = "0x6009A85")]
|
|
[Address(RVA = "0x41AB00", Offset = "0x419B00", VA = "0x18041AB00", Slot = "22")]
|
|
get
|
|
{
|
|
return this.c.StartDate.ToDateTime();
|
|
}
|
|
}
|
|
|
|
// Token: 0x170018A5 RID: 6309
|
|
// (get) Token: 0x06009A86 RID: 39558 RVA: 0x001F9478 File Offset: 0x001F7678
|
|
[Token(Token = "0x170018A5")]
|
|
public virtual DateTime NotAfter
|
|
{
|
|
[Token(Token = "0x6009A86")]
|
|
[Address(RVA = "0x41AAD0", Offset = "0x419AD0", VA = "0x18041AAD0", Slot = "23")]
|
|
get
|
|
{
|
|
return this.c.EndDate.ToDateTime();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009A87 RID: 39559 RVA: 0x001F949C File Offset: 0x001F769C
|
|
[Token(Token = "0x6009A87")]
|
|
[Address(RVA = "0x419800", Offset = "0x418800", VA = "0x180419800", Slot = "24")]
|
|
public virtual byte[] GetTbsCertificate()
|
|
{
|
|
return this.c.tbsCert.GetDerEncoded();
|
|
}
|
|
|
|
// Token: 0x06009A88 RID: 39560 RVA: 0x001F94C0 File Offset: 0x001F76C0
|
|
[Token(Token = "0x6009A88")]
|
|
[Address(RVA = "0x419790", Offset = "0x418790", VA = "0x180419790", Slot = "25")]
|
|
public virtual byte[] GetSignature()
|
|
{
|
|
return this.c.GetSignatureOctets();
|
|
}
|
|
|
|
// Token: 0x170018A6 RID: 6310
|
|
// (get) Token: 0x06009A89 RID: 39561 RVA: 0x001F94E0 File Offset: 0x001F76E0
|
|
[Token(Token = "0x170018A6")]
|
|
public virtual string SigAlgName
|
|
{
|
|
[Token(Token = "0x6009A89")]
|
|
[Address(RVA = "0x41AB60", Offset = "0x419B60", VA = "0x18041AB60", Slot = "26")]
|
|
get
|
|
{
|
|
Asn1Object asn1Object = this.c.sigAlgID.ToAsn1Object();
|
|
string text;
|
|
return text;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170018A7 RID: 6311
|
|
// (get) Token: 0x06009A8A RID: 39562 RVA: 0x001F9508 File Offset: 0x001F7708
|
|
[Token(Token = "0x170018A7")]
|
|
public virtual string SigAlgOid
|
|
{
|
|
[Token(Token = "0x6009A8A")]
|
|
[Address(RVA = "0x41ABE0", Offset = "0x419BE0", VA = "0x18041ABE0", Slot = "27")]
|
|
get
|
|
{
|
|
Asn1Object asn1Object = this.c.sigAlgID.ToAsn1Object();
|
|
throw new NullReferenceException();
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009A8B RID: 39563 RVA: 0x001F952C File Offset: 0x001F772C
|
|
[Token(Token = "0x6009A8B")]
|
|
[Address(RVA = "0x419710", Offset = "0x418710", VA = "0x180419710", Slot = "28")]
|
|
public virtual byte[] GetSigAlgParams()
|
|
{
|
|
if (this.c.sigAlgID.ObjectID == 0)
|
|
{
|
|
}
|
|
return this.c.sigAlgID.ObjectID.GetDerEncoded();
|
|
}
|
|
|
|
// Token: 0x170018A8 RID: 6312
|
|
// (get) Token: 0x06009A8C RID: 39564 RVA: 0x001F9568 File Offset: 0x001F7768
|
|
[Token(Token = "0x170018A8")]
|
|
public virtual DerBitString IssuerUniqueID
|
|
{
|
|
[Token(Token = "0x6009A8C")]
|
|
[Address(RVA = "0x41AAA0", Offset = "0x419AA0", VA = "0x18041AAA0", Slot = "29")]
|
|
get
|
|
{
|
|
return this.c.tbsCert.issuerUniqueID;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170018A9 RID: 6313
|
|
// (get) Token: 0x06009A8D RID: 39565 RVA: 0x001F958C File Offset: 0x001F778C
|
|
[Token(Token = "0x170018A9")]
|
|
public virtual DerBitString SubjectUniqueID
|
|
{
|
|
[Token(Token = "0x6009A8D")]
|
|
[Address(RVA = "0x41AC40", Offset = "0x419C40", VA = "0x18041AC40", Slot = "30")]
|
|
get
|
|
{
|
|
return this.c.tbsCert.subjectUniqueID;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009A8E RID: 39566 RVA: 0x001F95B0 File Offset: 0x001F77B0
|
|
[Token(Token = "0x6009A8E")]
|
|
[Address(RVA = "0x419660", Offset = "0x418660", VA = "0x180419660", Slot = "31")]
|
|
public virtual bool[] GetKeyUsage()
|
|
{
|
|
while (this.keyUsage != 0)
|
|
{
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009A8F RID: 39567 RVA: 0x001F95C8 File Offset: 0x001F77C8
|
|
[Token(Token = "0x6009A8F")]
|
|
[Address(RVA = "0x419210", Offset = "0x418210", VA = "0x180419210", Slot = "32")]
|
|
public virtual IList GetExtendedKeyUsage()
|
|
{
|
|
int num = 0;
|
|
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier("2.5.29.37");
|
|
if (this.GetCriticalExtensionOids() == 0)
|
|
{
|
|
throw new NullReferenceException();
|
|
}
|
|
Asn1Object asn1Object;
|
|
Asn1Sequence instance = Asn1Sequence.GetInstance(asn1Object);
|
|
IList list = Platform.CreateArrayList();
|
|
IEnumerator enumerator = instance.GetEnumerator();
|
|
if (enumerator != 0)
|
|
{
|
|
if (num < enumerator)
|
|
{
|
|
num += num;
|
|
num++;
|
|
}
|
|
if (enumerator == 0)
|
|
{
|
|
throw new NullReferenceException();
|
|
}
|
|
if (num < enumerator)
|
|
{
|
|
num += num;
|
|
num++;
|
|
}
|
|
num += 2;
|
|
num += 19;
|
|
}
|
|
if (num != 0)
|
|
{
|
|
}
|
|
if (num == 0)
|
|
{
|
|
return list;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009A90 RID: 39568 RVA: 0x001F9658 File Offset: 0x001F7858
|
|
[Token(Token = "0x6009A90")]
|
|
[Address(RVA = "0x419170", Offset = "0x418170", VA = "0x180419170", Slot = "33")]
|
|
public virtual int GetBasicConstraints()
|
|
{
|
|
BasicConstraints basicConstraints = this.basicConstraints;
|
|
if (basicConstraints == 0 || !basicConstraints.IsCA())
|
|
{
|
|
return -1;
|
|
}
|
|
if (this.basicConstraints.PathLenConstraint != 0)
|
|
{
|
|
return this.basicConstraints.PathLenConstraint.IntValue;
|
|
}
|
|
return int.MaxValue;
|
|
}
|
|
|
|
// Token: 0x06009A91 RID: 39569 RVA: 0x001F96A8 File Offset: 0x001F78A8
|
|
[Token(Token = "0x6009A91")]
|
|
[Address(RVA = "0x4197B0", Offset = "0x4187B0", VA = "0x1804197B0", Slot = "34")]
|
|
public virtual ICollection GetSubjectAlternativeNames()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009A91)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Collections.ICollection BestHTTP.SecureProtocol.Org.BouncyCastle.X509.X509Certificate::GetSubjectAlternativeNames()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:ISet(var_0_06, call:ISet(IX509Extension::GetCriticalExtensionOids, ldloc:X509Certificate[exp:IX509Extension](this)))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x06009A92 RID: 39570 RVA: 0x001F96BC File Offset: 0x001F78BC
|
|
[Token(Token = "0x6009A92")]
|
|
[Address(RVA = "0x419610", Offset = "0x418610", VA = "0x180419610", Slot = "35")]
|
|
public virtual ICollection GetIssuerAlternativeNames()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009A92)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Collections.ICollection BestHTTP.SecureProtocol.Org.BouncyCastle.X509.X509Certificate::GetIssuerAlternativeNames()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_0:
|
|
stloc:ISet(var_0_06, call:ISet(IX509Extension::GetCriticalExtensionOids, ldloc:X509Certificate[exp:IX509Extension](this)))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x06009A93 RID: 39571 RVA: 0x001F96D0 File Offset: 0x001F78D0
|
|
[Token(Token = "0x6009A93")]
|
|
[Address(RVA = "0x418F60", Offset = "0x417F60", VA = "0x180418F60", Slot = "36")]
|
|
protected virtual ICollection GetAlternativeNames(string oid)
|
|
{
|
|
DerObjectIdentifier derObjectIdentifier = new DerObjectIdentifier(oid);
|
|
if (this.GetCriticalExtensionOids() != 0)
|
|
{
|
|
Asn1Object asn1Object;
|
|
GeneralNames instance = GeneralNames.GetInstance(asn1Object);
|
|
IList list = Platform.CreateArrayList();
|
|
GeneralName[] names = instance.GetNames();
|
|
int num = 0;
|
|
int length = names.Length;
|
|
if (num < length)
|
|
{
|
|
GeneralName generalName = names[num];
|
|
IList list2 = Platform.CreateArrayList();
|
|
int tag = generalName.tag;
|
|
int hashCode = generalName.obj.GetHashCode();
|
|
num++;
|
|
}
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009A94 RID: 39572 RVA: 0x001F9750 File Offset: 0x001F7950
|
|
[Token(Token = "0x6009A94")]
|
|
[Address(RVA = "0x419830", Offset = "0x418830", VA = "0x180419830", Slot = "8")]
|
|
protected override X509Extensions GetX509Extensions()
|
|
{
|
|
int version = this.c.Version;
|
|
return this.c.tbsCert.extensions;
|
|
}
|
|
|
|
// Token: 0x06009A95 RID: 39573 RVA: 0x001F9784 File Offset: 0x001F7984
|
|
[Token(Token = "0x6009A95")]
|
|
[Address(RVA = "0x4196E0", Offset = "0x4186E0", VA = "0x1804196E0", Slot = "37")]
|
|
public virtual AsymmetricKeyParameter GetPublicKey()
|
|
{
|
|
return PublicKeyFactory.CreateKey(this.c.SubjectPublicKeyInfo);
|
|
}
|
|
|
|
// Token: 0x06009A96 RID: 39574 RVA: 0x001F97A8 File Offset: 0x001F79A8
|
|
[Token(Token = "0x6009A96")]
|
|
[Address(RVA = "0x4191F0", Offset = "0x4181F0", VA = "0x1804191F0", Slot = "38")]
|
|
public virtual byte[] GetEncoded()
|
|
{
|
|
return this.c.GetDerEncoded();
|
|
}
|
|
|
|
// Token: 0x06009A97 RID: 39575 RVA: 0x001F97C8 File Offset: 0x001F79C8
|
|
[Token(Token = "0x6009A97")]
|
|
[Address(RVA = "0x418EA0", Offset = "0x417EA0", VA = "0x180418EA0", Slot = "0")]
|
|
public override bool Equals(object obj)
|
|
{
|
|
if (obj != this)
|
|
{
|
|
if (obj != 0 && obj != 0)
|
|
{
|
|
Asn1Object asn1Object = this.c.ToAsn1Object();
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
// Token: 0x06009A98 RID: 39576 RVA: 0x001F97F8 File Offset: 0x001F79F8
|
|
[Token(Token = "0x6009A98")]
|
|
[Address(RVA = "0x419560", Offset = "0x418560", VA = "0x180419560", Slot = "2")]
|
|
public override int GetHashCode()
|
|
{
|
|
int num = 0;
|
|
if ((this.hashValueSet ? 1 : 0) == num)
|
|
{
|
|
this.c.Finalize();
|
|
this.hashValueSet = true;
|
|
}
|
|
Monitor.Exit(this);
|
|
if (num == 0)
|
|
{
|
|
return this.hashValue;
|
|
}
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009A99 RID: 39577 RVA: 0x001F9838 File Offset: 0x001F7A38
|
|
[Token(Token = "0x6009A99")]
|
|
[Address(RVA = "0x419A50", Offset = "0x418A50", VA = "0x180419A50", Slot = "3")]
|
|
public override string ToString()
|
|
{
|
|
StringBuilder stringBuilder;
|
|
X509Extensions extensions;
|
|
int num6;
|
|
do
|
|
{
|
|
stringBuilder = new StringBuilder();
|
|
string newLine = Platform.NewLine;
|
|
StringBuilder stringBuilder2 = stringBuilder.Append(" [0] Version: ");
|
|
StringBuilder stringBuilder4;
|
|
StringBuilder stringBuilder3 = stringBuilder4.Append(newLine);
|
|
StringBuilder stringBuilder5 = stringBuilder.Append(" SerialNumber: ");
|
|
int version = this.Version;
|
|
StringBuilder stringBuilder6 = stringBuilder5.Append(version).Append(newLine);
|
|
StringBuilder stringBuilder7 = stringBuilder.Append(" IssuerDN: ");
|
|
BigInteger serialNumber = this.SerialNumber;
|
|
StringBuilder stringBuilder8 = stringBuilder7.Append(serialNumber).Append(newLine);
|
|
StringBuilder stringBuilder9 = stringBuilder.Append(" Start Date: ");
|
|
X509Name subjectDN = this.SubjectDN;
|
|
StringBuilder stringBuilder10 = stringBuilder9.Append(subjectDN).Append(newLine);
|
|
StringBuilder stringBuilder11 = stringBuilder.Append(" Final Date: ");
|
|
DateTime notBefore = this.NotBefore;
|
|
StringBuilder stringBuilder12 = stringBuilder11.Append(notBefore).Append(newLine);
|
|
StringBuilder stringBuilder13 = stringBuilder.Append(" SubjectDN: ");
|
|
X509Name issuerDN = this.IssuerDN;
|
|
StringBuilder stringBuilder14 = stringBuilder13.Append(issuerDN).Append(newLine);
|
|
StringBuilder stringBuilder15 = stringBuilder.Append(" Public Key: ");
|
|
StringBuilder stringBuilder17;
|
|
StringBuilder stringBuilder16 = stringBuilder17.Append(newLine);
|
|
StringBuilder stringBuilder18 = stringBuilder.Append(" Signature Algorithm: ");
|
|
byte[] signature = this.GetSignature();
|
|
StringBuilder stringBuilder20;
|
|
StringBuilder stringBuilder19 = stringBuilder20.Append(newLine);
|
|
byte[] tbsCertificate = this.GetTbsCertificate();
|
|
StringBuilder stringBuilder21 = stringBuilder.Append(" Signature: ");
|
|
int num = 0;
|
|
string text = Hex.ToHexString(tbsCertificate, num, 20);
|
|
StringBuilder stringBuilder22 = stringBuilder21.Append(text).Append(newLine);
|
|
int length = tbsCertificate.Length;
|
|
uint num2;
|
|
if (num2 < (uint)length)
|
|
{
|
|
int num3 = tbsCertificate.Length;
|
|
num3 -= (int)num2;
|
|
int num4 = Math.Min(20, num3);
|
|
StringBuilder stringBuilder23 = stringBuilder.Append(" ");
|
|
string text2 = Hex.ToHexString(tbsCertificate, (int)num2, num4);
|
|
StringBuilder stringBuilder24 = stringBuilder23.Append(text2).Append(newLine);
|
|
num2 += (uint)20;
|
|
}
|
|
extensions = this.c.tbsCert.extensions;
|
|
if (extensions == 0)
|
|
{
|
|
goto IL_30B;
|
|
}
|
|
int num5;
|
|
if (extensions.ExtensionOids != 0)
|
|
{
|
|
num5 = 0;
|
|
StringBuilder stringBuilder25 = stringBuilder.Append(" Extensions: \n");
|
|
}
|
|
num6 = 0;
|
|
if (num6 < num5)
|
|
{
|
|
num6 += num6;
|
|
num6++;
|
|
}
|
|
if (num6 == 0)
|
|
{
|
|
num6++;
|
|
num6 += 19;
|
|
}
|
|
}
|
|
while (num6 == 0);
|
|
X509Extension extension = extensions.GetExtension(num6);
|
|
Asn1OctetString value = extension.value;
|
|
int num7;
|
|
if (value != 0)
|
|
{
|
|
Stream octetStream = value.GetOctetStream();
|
|
StringBuilder stringBuilder26 = stringBuilder.Append(" critical(");
|
|
bool critical = extension.critical;
|
|
StringBuilder stringBuilder27 = stringBuilder26.Append(critical).Append(") ");
|
|
StringBuilder stringBuilder28 = stringBuilder.Append(" value = ");
|
|
Asn1Object asn1Object;
|
|
string text3 = Asn1Dump.DumpAsString(asn1Object);
|
|
StringBuilder stringBuilder29 = stringBuilder28.Append(text3);
|
|
VerisignCzagExtension verisignCzagExtension = new VerisignCzagExtension(verisignCzagExtension);
|
|
StringBuilder stringBuilder30 = stringBuilder.Append(verisignCzagExtension);
|
|
NetscapeRevocationUrl netscapeRevocationUrl = new NetscapeRevocationUrl(netscapeRevocationUrl);
|
|
StringBuilder stringBuilder31 = stringBuilder.Append(netscapeRevocationUrl);
|
|
NetscapeCertType netscapeCertType = new NetscapeCertType(netscapeCertType);
|
|
StringBuilder stringBuilder32 = stringBuilder.Append(netscapeCertType);
|
|
KeyUsage instance = KeyUsage.GetInstance(asn1Object);
|
|
StringBuilder stringBuilder33 = stringBuilder.Append(instance);
|
|
BasicConstraints instance2 = BasicConstraints.GetInstance(asn1Object);
|
|
StringBuilder stringBuilder34 = stringBuilder.Append(instance2);
|
|
StringBuilder stringBuilder35 = stringBuilder.Append(" value = ").Append("*****");
|
|
num7 = 0;
|
|
}
|
|
num7 += num7;
|
|
num7++;
|
|
while (num7 != 0)
|
|
{
|
|
}
|
|
IL_30B:
|
|
int num8 = stringBuilder.GetHashCode();
|
|
num8 += 19;
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x06009A9A RID: 39578 RVA: 0x001F9B64 File Offset: 0x001F7D64
|
|
[Token(Token = "0x6009A9A")]
|
|
[Address(RVA = "0x41A690", Offset = "0x419690", VA = "0x18041A690", Slot = "39")]
|
|
public virtual void Verify(AsymmetricKeyParameter key)
|
|
{
|
|
Asn1VerifierFactory asn1VerifierFactory = new Asn1VerifierFactory(this.c.sigAlgID, key);
|
|
ISet criticalExtensionOids = ((IX509Extension)this).GetCriticalExtensionOids();
|
|
}
|
|
|
|
// Token: 0x06009A9B RID: 39579 RVA: 0x001F9B90 File Offset: 0x001F7D90
|
|
[Token(Token = "0x6009A9B")]
|
|
[Address(RVA = "0x41A610", Offset = "0x419610", VA = "0x18041A610", Slot = "40")]
|
|
public virtual void Verify(IVerifierFactoryProvider verifierProvider)
|
|
{
|
|
X509CertificateStructure x509CertificateStructure = this.c;
|
|
ISet criticalExtensionOids = ((IX509Extension)this).GetCriticalExtensionOids();
|
|
}
|
|
|
|
// Token: 0x06009A9C RID: 39580 RVA: 0x001F9BB4 File Offset: 0x001F7DB4
|
|
[Token(Token = "0x6009A9C")]
|
|
[Address(RVA = "0x418940", Offset = "0x417940", VA = "0x180418940", Slot = "41")]
|
|
protected virtual void CheckSignature(IVerifierFactory verifier)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009A9C)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.X509.X509Certificate::CheckSignature(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IVerifierFactory)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_AB:
|
|
stloc:CertificateException(var_14_B5, newobj:CertificateException(CertificateException::.ctor, ldstr:string("signature algorithm in TBS cert not same as outer cert")))
|
|
}
|
|
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
|
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x06009A9D RID: 39581 RVA: 0x001F9C78 File Offset: 0x001F7E78
|
|
[Token(Token = "0x6009A9D")]
|
|
[Address(RVA = "0x419880", Offset = "0x418880", VA = "0x180419880")]
|
|
private static bool IsAlgIDEqual(AlgorithmIdentifier id1, AlgorithmIdentifier id2)
|
|
{
|
|
Asn1Object asn1Object = id1.ToAsn1Object();
|
|
if (id2.ToAsn1Object() == 0)
|
|
{
|
|
throw new NullReferenceException();
|
|
}
|
|
DerObjectIdentifier objectID = id1.ObjectID;
|
|
DerObjectIdentifier objectID2 = id2.ObjectID;
|
|
bool flag = objectID2 == 0;
|
|
if (objectID == 0 != flag)
|
|
{
|
|
if (objectID == 0)
|
|
{
|
|
}
|
|
return objectID.ToAsn1Object() != 0;
|
|
}
|
|
return object.Equals(objectID, objectID2);
|
|
}
|
|
|
|
// Token: 0x0400683B RID: 26683
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x400683B")]
|
|
private readonly X509CertificateStructure c;
|
|
|
|
// Token: 0x0400683C RID: 26684
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x400683C")]
|
|
private readonly BasicConstraints basicConstraints;
|
|
|
|
// Token: 0x0400683D RID: 26685
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x400683D")]
|
|
private readonly bool[] keyUsage;
|
|
|
|
// Token: 0x0400683E RID: 26686
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x400683E")]
|
|
private bool hashValueSet;
|
|
|
|
// Token: 0x0400683F RID: 26687
|
|
[FieldOffset(Offset = "0x2C")]
|
|
[Token(Token = "0x400683F")]
|
|
private int hashValue;
|
|
}
|
|
}
|