Files
2026-04-10 22:50:51 +02:00

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: 0x02001902 RID: 6402
[Token(Token = "0x2001902")]
public class X509Certificate : X509ExtensionBase
{
// Token: 0x060096AC RID: 38572 RVA: 0x001F0184 File Offset: 0x001EE384
[Token(Token = "0x60096AC")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
protected X509Certificate()
{
}
// Token: 0x060096AD RID: 38573 RVA: 0x001F0198 File Offset: 0x001EE398
[Token(Token = "0x60096AD")]
[Address(RVA = "0x162D410", Offset = "0x162C210", VA = "0x18162D410")]
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: 0x17001801 RID: 6145
// (get) Token: 0x060096AE RID: 38574 RVA: 0x001F0288 File Offset: 0x001EE488
[Token(Token = "0x17001801")]
public virtual X509CertificateStructure CertificateStructure
{
[Token(Token = "0x60096AE")]
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20", Slot = "13")]
get
{
return this.c;
}
}
// Token: 0x17001802 RID: 6146
// (get) Token: 0x060096AF RID: 38575 RVA: 0x001F029C File Offset: 0x001EE49C
[Token(Token = "0x17001802")]
public virtual bool IsValidNow
{
[Token(Token = "0x60096AF")]
[Address(RVA = "0x162D6F0", Offset = "0x162C4F0", VA = "0x18162D6F0", Slot = "14")]
get
{
/*
An exception occurred when decompiling this method (060096AF)
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: 0x060096B0 RID: 38576 RVA: 0x001F02B8 File Offset: 0x001EE4B8
[Token(Token = "0x60096B0")]
[Address(RVA = "0x162C6C0", Offset = "0x162B4C0", VA = "0x18162C6C0", Slot = "15")]
public virtual bool IsValid(DateTime time)
{
X509Name subjectDN = this.SubjectDN;
DateTime notBefore = this.NotBefore;
int num;
return num <= 0;
}
// Token: 0x060096B1 RID: 38577 RVA: 0x001F02E0 File Offset: 0x001EE4E0
[Token(Token = "0x60096B1")]
[Address(RVA = "0x162B9A0", Offset = "0x162A7A0", VA = "0x18162B9A0", Slot = "16")]
public virtual void CheckValidity()
{
DateTime utcNow = DateTime.UtcNow;
ISet criticalExtensionOids = ((IX509Extension)this).GetCriticalExtensionOids();
}
// Token: 0x060096B2 RID: 38578 RVA: 0x001F02FC File Offset: 0x001EE4FC
[Token(Token = "0x60096B2")]
[Address(RVA = "0x162BA10", Offset = "0x162A810", VA = "0x18162BA10", Slot = "17")]
public virtual void CheckValidity(DateTime time)
{
DateTime notBefore = this.NotBefore;
X509Name subjectDN = this.SubjectDN;
}
// Token: 0x17001803 RID: 6147
// (get) Token: 0x060096B3 RID: 38579 RVA: 0x001F0338 File Offset: 0x001EE538
[Token(Token = "0x17001803")]
public virtual int Version
{
[Token(Token = "0x60096B3")]
[Address(RVA = "0x162D950", Offset = "0x162C750", VA = "0x18162D950", Slot = "18")]
get
{
return this.c.Version;
}
}
// Token: 0x17001804 RID: 6148
// (get) Token: 0x060096B4 RID: 38580 RVA: 0x001F0358 File Offset: 0x001EE558
[Token(Token = "0x17001804")]
public virtual BigInteger SerialNumber
{
[Token(Token = "0x60096B4")]
[Address(RVA = "0x162D810", Offset = "0x162C610", VA = "0x18162D810", Slot = "19")]
get
{
return this.c.SerialNumber.Value;
}
}
// Token: 0x17001805 RID: 6149
// (get) Token: 0x060096B5 RID: 38581 RVA: 0x001F037C File Offset: 0x001EE57C
[Token(Token = "0x17001805")]
public virtual X509Name IssuerDN
{
[Token(Token = "0x60096B5")]
[Address(RVA = "0x162D760", Offset = "0x162C560", VA = "0x18162D760", Slot = "20")]
get
{
return this.c.Issuer;
}
}
// Token: 0x17001806 RID: 6150
// (get) Token: 0x060096B6 RID: 38582 RVA: 0x001F039C File Offset: 0x001EE59C
[Token(Token = "0x17001806")]
public virtual X509Name SubjectDN
{
[Token(Token = "0x60096B6")]
[Address(RVA = "0x162D900", Offset = "0x162C700", VA = "0x18162D900", Slot = "21")]
get
{
return this.c.Subject;
}
}
// Token: 0x17001807 RID: 6151
// (get) Token: 0x060096B7 RID: 38583 RVA: 0x001F03BC File Offset: 0x001EE5BC
[Token(Token = "0x17001807")]
public virtual DateTime NotBefore
{
[Token(Token = "0x60096B7")]
[Address(RVA = "0x162D7E0", Offset = "0x162C5E0", VA = "0x18162D7E0", Slot = "22")]
get
{
return this.c.StartDate.ToDateTime();
}
}
// Token: 0x17001808 RID: 6152
// (get) Token: 0x060096B8 RID: 38584 RVA: 0x001F03E0 File Offset: 0x001EE5E0
[Token(Token = "0x17001808")]
public virtual DateTime NotAfter
{
[Token(Token = "0x60096B8")]
[Address(RVA = "0x162D7B0", Offset = "0x162C5B0", VA = "0x18162D7B0", Slot = "23")]
get
{
return this.c.EndDate.ToDateTime();
}
}
// Token: 0x060096B9 RID: 38585 RVA: 0x001F0404 File Offset: 0x001EE604
[Token(Token = "0x60096B9")]
[Address(RVA = "0x162C4E0", Offset = "0x162B2E0", VA = "0x18162C4E0", Slot = "24")]
public virtual byte[] GetTbsCertificate()
{
return this.c.tbsCert.GetDerEncoded();
}
// Token: 0x060096BA RID: 38586 RVA: 0x001F0428 File Offset: 0x001EE628
[Token(Token = "0x60096BA")]
[Address(RVA = "0x162C470", Offset = "0x162B270", VA = "0x18162C470", Slot = "25")]
public virtual byte[] GetSignature()
{
return this.c.GetSignatureOctets();
}
// Token: 0x17001809 RID: 6153
// (get) Token: 0x060096BB RID: 38587 RVA: 0x001F0448 File Offset: 0x001EE648
[Token(Token = "0x17001809")]
public virtual string SigAlgName
{
[Token(Token = "0x60096BB")]
[Address(RVA = "0x162D840", Offset = "0x162C640", VA = "0x18162D840", Slot = "26")]
get
{
Asn1Object asn1Object = this.c.sigAlgID.ToAsn1Object();
string text;
return text;
}
}
// Token: 0x1700180A RID: 6154
// (get) Token: 0x060096BC RID: 38588 RVA: 0x001F0470 File Offset: 0x001EE670
[Token(Token = "0x1700180A")]
public virtual string SigAlgOid
{
[Token(Token = "0x60096BC")]
[Address(RVA = "0x162D8C0", Offset = "0x162C6C0", VA = "0x18162D8C0", Slot = "27")]
get
{
Asn1Object asn1Object = this.c.sigAlgID.ToAsn1Object();
throw new NullReferenceException();
}
}
// Token: 0x060096BD RID: 38589 RVA: 0x001F0494 File Offset: 0x001EE694
[Token(Token = "0x60096BD")]
[Address(RVA = "0x162C3F0", Offset = "0x162B1F0", VA = "0x18162C3F0", Slot = "28")]
public virtual byte[] GetSigAlgParams()
{
if (this.c.sigAlgID.ObjectID == 0)
{
}
return this.c.sigAlgID.ObjectID.GetDerEncoded();
}
// Token: 0x1700180B RID: 6155
// (get) Token: 0x060096BE RID: 38590 RVA: 0x001F04D0 File Offset: 0x001EE6D0
[Token(Token = "0x1700180B")]
public virtual DerBitString IssuerUniqueID
{
[Token(Token = "0x60096BE")]
[Address(RVA = "0x162D780", Offset = "0x162C580", VA = "0x18162D780", Slot = "29")]
get
{
return this.c.tbsCert.issuerUniqueID;
}
}
// Token: 0x1700180C RID: 6156
// (get) Token: 0x060096BF RID: 38591 RVA: 0x001F04F4 File Offset: 0x001EE6F4
[Token(Token = "0x1700180C")]
public virtual DerBitString SubjectUniqueID
{
[Token(Token = "0x60096BF")]
[Address(RVA = "0x162D920", Offset = "0x162C720", VA = "0x18162D920", Slot = "30")]
get
{
return this.c.tbsCert.subjectUniqueID;
}
}
// Token: 0x060096C0 RID: 38592 RVA: 0x001F0518 File Offset: 0x001EE718
[Token(Token = "0x60096C0")]
[Address(RVA = "0x162C340", Offset = "0x162B140", VA = "0x18162C340", Slot = "31")]
public virtual bool[] GetKeyUsage()
{
while (this.keyUsage != 0)
{
}
}
// Token: 0x060096C1 RID: 38593 RVA: 0x001F0530 File Offset: 0x001EE730
[Token(Token = "0x60096C1")]
[Address(RVA = "0x162BEF0", Offset = "0x162ACF0", VA = "0x18162BEF0", 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: 0x060096C2 RID: 38594 RVA: 0x001F05C0 File Offset: 0x001EE7C0
[Token(Token = "0x60096C2")]
[Address(RVA = "0x162BE50", Offset = "0x162AC50", VA = "0x18162BE50", 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: 0x060096C3 RID: 38595 RVA: 0x001F0610 File Offset: 0x001EE810
[Token(Token = "0x60096C3")]
[Address(RVA = "0x162C490", Offset = "0x162B290", VA = "0x18162C490", Slot = "34")]
public virtual ICollection GetSubjectAlternativeNames()
{
/*
An exception occurred when decompiling this method (060096C3)
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: 0x060096C4 RID: 38596 RVA: 0x001F0624 File Offset: 0x001EE824
[Token(Token = "0x60096C4")]
[Address(RVA = "0x162C2F0", Offset = "0x162B0F0", VA = "0x18162C2F0", Slot = "35")]
public virtual ICollection GetIssuerAlternativeNames()
{
/*
An exception occurred when decompiling this method (060096C4)
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: 0x060096C5 RID: 38597 RVA: 0x001F0638 File Offset: 0x001EE838
[Token(Token = "0x60096C5")]
[Address(RVA = "0x162BC40", Offset = "0x162AA40", VA = "0x18162BC40", 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: 0x060096C6 RID: 38598 RVA: 0x001F06B8 File Offset: 0x001EE8B8
[Token(Token = "0x60096C6")]
[Address(RVA = "0x162C510", Offset = "0x162B310", VA = "0x18162C510", Slot = "8")]
protected override X509Extensions GetX509Extensions()
{
int version = this.c.Version;
return this.c.tbsCert.extensions;
}
// Token: 0x060096C7 RID: 38599 RVA: 0x001F06EC File Offset: 0x001EE8EC
[Token(Token = "0x60096C7")]
[Address(RVA = "0x162C3C0", Offset = "0x162B1C0", VA = "0x18162C3C0", Slot = "37")]
public virtual AsymmetricKeyParameter GetPublicKey()
{
return PublicKeyFactory.CreateKey(this.c.SubjectPublicKeyInfo);
}
// Token: 0x060096C8 RID: 38600 RVA: 0x001F0710 File Offset: 0x001EE910
[Token(Token = "0x60096C8")]
[Address(RVA = "0x162BED0", Offset = "0x162ACD0", VA = "0x18162BED0", Slot = "38")]
public virtual byte[] GetEncoded()
{
return this.c.GetDerEncoded();
}
// Token: 0x060096C9 RID: 38601 RVA: 0x001F0730 File Offset: 0x001EE930
[Token(Token = "0x60096C9")]
[Address(RVA = "0x162BB80", Offset = "0x162A980", VA = "0x18162BB80", Slot = "0")]
public override bool Equals(object obj)
{
if (obj != this)
{
if (obj != 0 && obj != 0)
{
Asn1Object asn1Object = this.c.ToAsn1Object();
}
}
return true;
}
// Token: 0x060096CA RID: 38602 RVA: 0x001F0760 File Offset: 0x001EE960
[Token(Token = "0x60096CA")]
[Address(RVA = "0x162C240", Offset = "0x162B040", VA = "0x18162C240", 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: 0x060096CB RID: 38603 RVA: 0x001F07A0 File Offset: 0x001EE9A0
[Token(Token = "0x60096CB")]
[Address(RVA = "0x162C730", Offset = "0x162B530", VA = "0x18162C730", 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: 0x060096CC RID: 38604 RVA: 0x001F0ACC File Offset: 0x001EECCC
[Token(Token = "0x60096CC")]
[Address(RVA = "0x162D370", Offset = "0x162C170", VA = "0x18162D370", Slot = "39")]
public virtual void Verify(AsymmetricKeyParameter key)
{
Asn1VerifierFactory asn1VerifierFactory = new Asn1VerifierFactory(this.c.sigAlgID, key);
ISet criticalExtensionOids = ((IX509Extension)this).GetCriticalExtensionOids();
}
// Token: 0x060096CD RID: 38605 RVA: 0x001F0AF8 File Offset: 0x001EECF8
[Token(Token = "0x60096CD")]
[Address(RVA = "0x162D2F0", Offset = "0x162C0F0", VA = "0x18162D2F0", Slot = "40")]
public virtual void Verify(IVerifierFactoryProvider verifierProvider)
{
X509CertificateStructure x509CertificateStructure = this.c;
ISet criticalExtensionOids = ((IX509Extension)this).GetCriticalExtensionOids();
}
// Token: 0x060096CE RID: 38606 RVA: 0x001F0B1C File Offset: 0x001EED1C
[Token(Token = "0x60096CE")]
[Address(RVA = "0x162B620", Offset = "0x162A420", VA = "0x18162B620", Slot = "41")]
protected virtual void CheckSignature(IVerifierFactory verifier)
{
/*
An exception occurred when decompiling this method (060096CE)
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: 0x060096CF RID: 38607 RVA: 0x001F0BE0 File Offset: 0x001EEDE0
[Token(Token = "0x60096CF")]
[Address(RVA = "0x162C560", Offset = "0x162B360", VA = "0x18162C560")]
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: 0x04006682 RID: 26242
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006682")]
private readonly X509CertificateStructure c;
// Token: 0x04006683 RID: 26243
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006683")]
private readonly BasicConstraints basicConstraints;
// Token: 0x04006684 RID: 26244
[FieldOffset(Offset = "0x20")]
[Token(Token = "0x4006684")]
private readonly bool[] keyUsage;
// Token: 0x04006685 RID: 26245
[FieldOffset(Offset = "0x28")]
[Token(Token = "0x4006685")]
private bool hashValueSet;
// Token: 0x04006686 RID: 26246
[FieldOffset(Offset = "0x2C")]
[Token(Token = "0x4006686")]
private int hashValue;
}
}