163 lines
6.8 KiB
C#
163 lines
6.8 KiB
C#
using System;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto;
|
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509
|
|
{
|
|
// Token: 0x020019E3 RID: 6627
|
|
[Token(Token = "0x20019E3")]
|
|
public class X509CertificatePair
|
|
{
|
|
// Token: 0x06009A9E RID: 39582 RVA: 0x001F9CD0 File Offset: 0x001F7ED0
|
|
[Token(Token = "0x6009A9E")]
|
|
[Address(RVA = "0x417DD0", Offset = "0x416DD0", VA = "0x180417DD0")]
|
|
public X509CertificatePair(X509Certificate forward, X509Certificate reverse)
|
|
{
|
|
this.forward = forward;
|
|
this.reverse = reverse;
|
|
}
|
|
|
|
// Token: 0x06009A9F RID: 39583 RVA: 0x001F9CF4 File Offset: 0x001F7EF4
|
|
[Token(Token = "0x6009A9F")]
|
|
[Address(RVA = "0x417E10", Offset = "0x416E10", VA = "0x180417E10")]
|
|
public X509CertificatePair(CertificatePair pair)
|
|
{
|
|
X509CertificateStructure x509CertificateStructure = pair.forward;
|
|
if (x509CertificateStructure != 0)
|
|
{
|
|
X509Certificate x509Certificate = new X509Certificate(x509CertificateStructure);
|
|
this.forward = x509Certificate;
|
|
}
|
|
X509CertificateStructure x509CertificateStructure2 = pair.reverse;
|
|
if (x509CertificateStructure2 != 0)
|
|
{
|
|
X509Certificate x509Certificate2 = new X509Certificate(x509CertificateStructure2);
|
|
this.reverse = x509Certificate2;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009AA0 RID: 39584 RVA: 0x001F9D40 File Offset: 0x001F7F40
|
|
[Token(Token = "0x6009AA0")]
|
|
[Address(RVA = "0x417BA0", Offset = "0x416BA0", VA = "0x180417BA0")]
|
|
public byte[] GetEncoded()
|
|
{
|
|
int num = 0;
|
|
X509Certificate x509Certificate = this.forward;
|
|
if (x509Certificate != 0)
|
|
{
|
|
AsymmetricKeyParameter publicKey = x509Certificate.GetPublicKey();
|
|
Asn1Object asn1Object;
|
|
if (X509CertificateStructure.GetInstance(asn1Object) == 0)
|
|
{
|
|
CertificateEncodingException ex = new CertificateEncodingException("unable to get encoding for forward");
|
|
goto IL_61;
|
|
}
|
|
}
|
|
X509Certificate x509Certificate2 = this.reverse;
|
|
X509CertificateStructure instance;
|
|
if (x509Certificate2 != 0)
|
|
{
|
|
AsymmetricKeyParameter publicKey2 = x509Certificate2.GetPublicKey();
|
|
Asn1Object asn1Object2;
|
|
instance = X509CertificateStructure.GetInstance(asn1Object2);
|
|
if (instance == 0)
|
|
{
|
|
goto IL_61;
|
|
}
|
|
}
|
|
return new CertificatePair(num, instance).GetDerEncoded();
|
|
IL_61:
|
|
CertificateEncodingException ex2 = new CertificateEncodingException("unable to get encoding for reverse");
|
|
throw new NullReferenceException();
|
|
}
|
|
|
|
// Token: 0x170018AA RID: 6314
|
|
// (get) Token: 0x06009AA1 RID: 39585 RVA: 0x001F9DC0 File Offset: 0x001F7FC0
|
|
[Token(Token = "0x170018AA")]
|
|
public X509Certificate Forward
|
|
{
|
|
[Token(Token = "0x6009AA1")]
|
|
[Address(RVA = "0x411530", Offset = "0x410530", VA = "0x180411530")]
|
|
get
|
|
{
|
|
return this.forward;
|
|
}
|
|
}
|
|
|
|
// Token: 0x170018AB RID: 6315
|
|
// (get) Token: 0x06009AA2 RID: 39586 RVA: 0x001F9DD4 File Offset: 0x001F7FD4
|
|
[Token(Token = "0x170018AB")]
|
|
public X509Certificate Reverse
|
|
{
|
|
[Token(Token = "0x6009AA2")]
|
|
[Address(RVA = "0x4157B0", Offset = "0x4147B0", VA = "0x1804157B0")]
|
|
get
|
|
{
|
|
return this.reverse;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06009AA3 RID: 39587 RVA: 0x001F9DE8 File Offset: 0x001F7FE8
|
|
[Token(Token = "0x6009AA3")]
|
|
[Address(RVA = "0x417AD0", Offset = "0x416AD0", VA = "0x180417AD0", Slot = "0")]
|
|
public override bool Equals(object obj)
|
|
{
|
|
if (obj != this)
|
|
{
|
|
if (obj != 0 && obj != 0)
|
|
{
|
|
X509Certificate x509Certificate = this.forward;
|
|
bool flag;
|
|
if (flag)
|
|
{
|
|
X509Certificate x509Certificate2 = this.reverse;
|
|
bool flag2;
|
|
return flag2;
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
// Token: 0x06009AA4 RID: 39588 RVA: 0x001F9E1C File Offset: 0x001F801C
|
|
[Token(Token = "0x6009AA4")]
|
|
[Address(RVA = "0x417D60", Offset = "0x416D60", VA = "0x180417D60", Slot = "2")]
|
|
public override int GetHashCode()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009AA4)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.X509.X509CertificatePair::GetHashCode()
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
Block_1:
|
|
callvirt:void(object::Finalize, ldloc:X509Certificate[exp:object](var_1_17))
|
|
stloc:int64(var_2_28, mul:uint32[exp:int64](conv.u4:uint32(ldc.i4:int32[exp:uint32](-1)), conv.u4:uint32(ldc.i4:int32[exp:uint32](17))))
|
|
}
|
|
|
|
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: 0x04006840 RID: 26688
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006840")]
|
|
private readonly X509Certificate forward;
|
|
|
|
// Token: 0x04006841 RID: 26689
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4006841")]
|
|
private readonly X509Certificate reverse;
|
|
}
|
|
}
|