terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
X509Builder.cs
Go to the documentation of this file.
1using System;
5
6namespace Mono.Security.X509
7{
8 // Token: 0x02000012 RID: 18
9 public abstract class X509Builder
10 {
11 // Token: 0x0600009D RID: 157 RVA: 0x00004BC4 File Offset: 0x00002DC4
12 protected X509Builder()
13 {
14 this.hashName = "SHA1";
15 }
16
17 // Token: 0x0600009E RID: 158
18 protected abstract ASN1 ToBeSigned(string hashName);
19
20 // Token: 0x0600009F RID: 159 RVA: 0x00004BE4 File Offset: 0x00002DE4
21 protected string GetOid(string hashName)
22 {
23 if (!true)
24 {
25 }
27 string text = hashName.ToLower(invariantCulture);
28 uint num = <PrivateImplementationDetails>.ComputeStringHash(text);
29 bool flag = text == "sha1";
30 bool flag2 = text == "sha256";
31 bool flag3 = text == "sha384";
32 bool flag4 = text == "md4";
33 bool flag5 = text == "md5";
34 bool flag6 = text == "md2";
35 bool flag7 = text == "sha512";
36 return "1.2.840.113549.1.1.13";
37 }
38
39 // Token: 0x17000023 RID: 35
40 // (get) Token: 0x060000A0 RID: 160 RVA: 0x00004C78 File Offset: 0x00002E78
41 // (set) Token: 0x060000A1 RID: 161 RVA: 0x00004C8C File Offset: 0x00002E8C
42 public string Hash
43 {
44 get
45 {
46 return this.hashName;
47 }
48 set
49 {
50 if (this.hashName != null)
51 {
53 return;
54 }
55 this.hashName = "SHA1";
56 }
57 }
58
59 // Token: 0x060000A2 RID: 162 RVA: 0x00002050 File Offset: 0x00000250
60 public virtual byte[] Sign(AsymmetricAlgorithm aa)
61 {
62 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
63 }
64
65 // Token: 0x060000A3 RID: 163 RVA: 0x00004CB4 File Offset: 0x00002EB4
66 private byte[] Build(ASN1 tbs, string hashoid, byte[] signature)
67 {
68 /*
69An exception occurred when decompiling this method (060000A3)
70
71ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] Mono.Security.X509.X509Builder::Build(Mono.Security.ASN1,System.String,System.Byte[])
72
73 ---> System.Exception: Basic block has to end with unconditional control flow.
74{
75 Block_0:
76 stloc:ASN1(var_1_06, call:ASN1(PKCS7::AlgorithmIdentifier, ldloc:string(hashoid)))
77}
78
79 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
80 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
81 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
82 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
83 --- End of inner exception stack trace ---
84 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
85 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 1683
86*/;
87 }
88
89 // Token: 0x060000A4 RID: 164 RVA: 0x00004CC8 File Offset: 0x00002EC8
90 public virtual byte[] Sign(RSA key)
91 {
92 string text = this.hashName;
93 HashAlgorithm hashAlgorithm = HashAlgorithm.Create(this.hashName);
94 string text2 = this.hashName;
95 byte[] array;
96 return array;
97 }
98
99 // Token: 0x060000A5 RID: 165 RVA: 0x00004CF4 File Offset: 0x00002EF4
100 public virtual byte[] Sign(DSA key)
101 {
102 while (HashAlgorithm.Create(this.hashName) == null)
103 {
104 }
105 string text = this.hashName;
106 byte[] array;
107 return array;
108 }
109
110 // Token: 0x0400005A RID: 90
111 private const string defaultHash = "SHA1";
112
113 // Token: 0x0400005B RID: 91
114 private string hashName;
115 }
116}
class f__AnonymousType0<< Count > j__TPar
ASN1 ToBeSigned(string hashName)
string GetOid(string hashName)
virtual byte[] Sign(RSA key)
byte[] Build(ASN1 tbs, string hashoid, byte[] signature)
virtual byte[] Sign(AsymmetricAlgorithm aa)
virtual byte[] Sign(DSA key)
static CultureInfo InvariantCulture