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: 0x02001903 RID: 6403
|
|
[Token(Token = "0x2001903")]
|
|
public class X509CertificatePair
|
|
{
|
|
// Token: 0x060096D0 RID: 38608 RVA: 0x001F0C38 File Offset: 0x001EEE38
|
|
[Token(Token = "0x60096D0")]
|
|
[Address(RVA = "0x4089A0", Offset = "0x4077A0", VA = "0x1804089A0")]
|
|
public X509CertificatePair(X509Certificate forward, X509Certificate reverse)
|
|
{
|
|
this.forward = forward;
|
|
this.reverse = reverse;
|
|
}
|
|
|
|
// Token: 0x060096D1 RID: 38609 RVA: 0x001F0C5C File Offset: 0x001EEE5C
|
|
[Token(Token = "0x60096D1")]
|
|
[Address(RVA = "0x162AAF0", Offset = "0x16298F0", VA = "0x18162AAF0")]
|
|
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: 0x060096D2 RID: 38610 RVA: 0x001F0CA8 File Offset: 0x001EEEA8
|
|
[Token(Token = "0x60096D2")]
|
|
[Address(RVA = "0x162A8C0", Offset = "0x16296C0", VA = "0x18162A8C0")]
|
|
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: 0x1700180D RID: 6157
|
|
// (get) Token: 0x060096D3 RID: 38611 RVA: 0x001F0D28 File Offset: 0x001EEF28
|
|
[Token(Token = "0x1700180D")]
|
|
public X509Certificate Forward
|
|
{
|
|
[Token(Token = "0x60096D3")]
|
|
[Address(RVA = "0x3F6E20", Offset = "0x3F5C20", VA = "0x1803F6E20")]
|
|
get
|
|
{
|
|
return this.forward;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700180E RID: 6158
|
|
// (get) Token: 0x060096D4 RID: 38612 RVA: 0x001F0D3C File Offset: 0x001EEF3C
|
|
[Token(Token = "0x1700180E")]
|
|
public X509Certificate Reverse
|
|
{
|
|
[Token(Token = "0x60096D4")]
|
|
[Address(RVA = "0x3F5F40", Offset = "0x3F4D40", VA = "0x1803F5F40")]
|
|
get
|
|
{
|
|
return this.reverse;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060096D5 RID: 38613 RVA: 0x001F0D50 File Offset: 0x001EEF50
|
|
[Token(Token = "0x60096D5")]
|
|
[Address(RVA = "0x162A7F0", Offset = "0x16295F0", VA = "0x18162A7F0", 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: 0x060096D6 RID: 38614 RVA: 0x001F0D84 File Offset: 0x001EEF84
|
|
[Token(Token = "0x60096D6")]
|
|
[Address(RVA = "0x162AA80", Offset = "0x1629880", VA = "0x18162AA80", Slot = "2")]
|
|
public override int GetHashCode()
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060096D6)
|
|
|
|
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: 0x04006687 RID: 26247
|
|
[FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x4006687")]
|
|
private readonly X509Certificate forward;
|
|
|
|
// Token: 0x04006688 RID: 26248
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4006688")]
|
|
private readonly X509Certificate reverse;
|
|
}
|
|
}
|