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
PKCS8.cs
Go to the documentation of this file.
1using System;
5
7{
8 // Token: 0x02000059 RID: 89
9 public sealed class PKCS8
10 {
11 // Token: 0x0200005A RID: 90
12 public class PrivateKeyInfo
13 {
14 // Token: 0x06000266 RID: 614 RVA: 0x000098A4 File Offset: 0x00007AA4
16 {
17 }
18
19 // Token: 0x06000267 RID: 615 RVA: 0x000098B8 File Offset: 0x00007AB8
20 public PrivateKeyInfo(byte[] data)
21 {
22 this.Decode(data);
23 }
24
25 // Token: 0x170000B1 RID: 177
26 // (get) Token: 0x06000268 RID: 616 RVA: 0x000098CC File Offset: 0x00007ACC
27 // (set) Token: 0x06000269 RID: 617 RVA: 0x000098E0 File Offset: 0x00007AE0
28 public string Algorithm
29 {
30 get
31 {
32 return this._algorithm;
33 }
34 set
35 {
37 }
38 }
39
40 // Token: 0x170000B2 RID: 178
41 // (get) Token: 0x0600026A RID: 618 RVA: 0x000098F4 File Offset: 0x00007AF4
42 // (set) Token: 0x0600026B RID: 619 RVA: 0x00009914 File Offset: 0x00007B14
43 public byte[] PrivateKey
44 {
45 get
46 {
47 object obj;
48 if (this._key == null || obj == null || obj != null)
49 {
50 }
51 throw new InvalidCastException();
52 }
53 set
54 {
55 if (value != null)
56 {
57 object obj;
58 if (obj != null)
59 {
60 if (obj == null)
61 {
62 goto IL_001A;
63 }
64 this._key = obj;
65 if (obj == null)
66 {
67 throw new InvalidCastException();
68 }
69 }
70 return;
71 }
72 IL_001A:
73 throw new InvalidCastException();
74 }
75 }
76
77 // Token: 0x0600026C RID: 620 RVA: 0x00009940 File Offset: 0x00007B40
78 private void Decode(byte[] data)
79 {
80 ASN1 asn;
81 byte nTag = asn.m_nTag;
82 byte[] value = asn.Value;
83 this._version = (int)nTag;
84 ASN1 asn2;
85 byte nTag2 = asn2.m_nTag;
86 long num = 0L;
87 ASN1 asn3 = asn2[(int)num];
88 byte nTag3 = asn3.m_nTag;
89 string text = ASN1Convert.ToOid(asn3);
91 ASN1 asn4;
92 byte[] value2 = asn4.Value;
94 ASN1 asn5;
95 int count = asn5.Count;
96 long num2 = 0L;
97 ArrayList list = this._list;
98 ASN1 asn6 = asn5[(int)num2];
99 int count2 = asn5.Count;
100 }
101
102 // Token: 0x0600026D RID: 621 RVA: 0x000099E0 File Offset: 0x00007BE0
103 public byte[] GetBytes()
104 {
106 int version = this._version;
107 byte[] key = this._key;
108 ArrayList list = this._list;
109 ArrayList list2 = this._list;
110 if (list2 != null)
111 {
112 }
113 long num = 0L;
114 int num2 = 5;
115 if (list2 != null)
116 {
117 }
118 if (num == 0L)
119 {
120 if (num2 == 0)
121 {
122 }
123 throw new InvalidCastException();
124 }
125 throw new OutOfMemoryException();
126 }
127
128 // Token: 0x0600026E RID: 622 RVA: 0x00009A64 File Offset: 0x00007C64
129 private static byte[] RemoveLeadingZero(byte[] bigInt)
130 {
131 }
132
133 // Token: 0x0600026F RID: 623 RVA: 0x00009A74 File Offset: 0x00007C74
134 private static byte[] Normalize(byte[] bigInt, int length)
135 {
136 byte[] array;
137 return array;
138 }
139
140 // Token: 0x06000270 RID: 624 RVA: 0x00009A84 File Offset: 0x00007C84
141 public static RSA DecodeRSA(byte[] keypair)
142 {
143 ASN1 asn;
144 byte nTag = asn.m_nTag;
145 ASN1 asn2;
147 ASN1 asn3;
148 byte[] array2 = PKCS8.PrivateKeyInfo.Normalize(asn3.Value, 43151360);
149 long num = 0L;
150 ASN1 asn4;
151 byte[] array3 = PKCS8.PrivateKeyInfo.Normalize(asn4.Value, (int)num);
152 long num2 = 0L;
153 ASN1 asn5;
154 byte[] array4 = PKCS8.PrivateKeyInfo.Normalize(asn5.Value, (int)num2);
155 ASN1 asn6;
157 long num3 = 0L;
158 ASN1 asn7;
159 byte[] array6 = PKCS8.PrivateKeyInfo.Normalize(asn7.Value, (int)num3);
160 long num4 = 0L;
161 ASN1 asn8;
162 byte[] array7 = PKCS8.PrivateKeyInfo.Normalize(asn8.Value, (int)num4);
163 long num5 = 0L;
164 ASN1 asn9;
165 byte[] array8 = PKCS8.PrivateKeyInfo.Normalize(asn9.Value, (int)num5);
166 return RSA.Create();
167 }
168
169 // Token: 0x06000271 RID: 625 RVA: 0x00009B5C File Offset: 0x00007D5C
170 public static byte[] Encode(RSA rsa)
171 {
172 /*
173An exception occurred when decompiling this method (06000271)
174
175ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] Mono.Security.Cryptography.PKCS8/PrivateKeyInfo::Encode(System.Security.Cryptography.RSA)
176
177 ---> System.Exception: Basic block has to end with unconditional control flow.
178{
179 Block_0:
180 stloc:ASN1(var_10_09, call:ASN1(ASN1::Add, ldloc:ASN1(var_9), ldloc:ASN1(var_9)))
181}
182
183 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
184 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
185 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
186 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
187 --- End of inner exception stack trace ---
188 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
189 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
190*/;
191 }
192
193 // Token: 0x06000272 RID: 626 RVA: 0x00009B74 File Offset: 0x00007D74
195 {
196 byte[] array2;
198 DSA dsa = DSA.Create();
199 byte value = privateKey.m_value;
200 return dsa;
201 }
202
203 // Token: 0x06000273 RID: 627 RVA: 0x00002050 File Offset: 0x00000250
204 public static byte[] Encode(DSA dsa)
205 {
206 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
207 }
208
209 // Token: 0x06000274 RID: 628 RVA: 0x00009B9C File Offset: 0x00007D9C
210 public static byte[] Encode(AsymmetricAlgorithm aa)
211 {
212 byte[] array;
213 return array;
214 }
215
216 // Token: 0x04000263 RID: 611
217 private int _version;
218
219 // Token: 0x04000264 RID: 612
220 private string _algorithm;
221
222 // Token: 0x04000265 RID: 613
223 private byte[] _key;
224
225 // Token: 0x04000266 RID: 614
227 }
228
229 // Token: 0x0200005B RID: 91
231 {
232 // Token: 0x06000275 RID: 629 RVA: 0x00009BAC File Offset: 0x00007DAC
234 {
235 }
236
237 // Token: 0x06000276 RID: 630 RVA: 0x00009BC0 File Offset: 0x00007DC0
238 public EncryptedPrivateKeyInfo(byte[] data)
239 {
240 this.Decode(data);
241 }
242
243 // Token: 0x170000B3 RID: 179
244 // (get) Token: 0x06000277 RID: 631 RVA: 0x00009BDC File Offset: 0x00007DDC
245 // (set) Token: 0x06000278 RID: 632 RVA: 0x00009BF0 File Offset: 0x00007DF0
246 public string Algorithm
247 {
248 get
249 {
250 return this._algorithm;
251 }
252 set
253 {
255 }
256 }
257
258 // Token: 0x170000B4 RID: 180
259 // (get) Token: 0x06000279 RID: 633 RVA: 0x00009C04 File Offset: 0x00007E04
260 // (set) Token: 0x0600027A RID: 634 RVA: 0x00009C24 File Offset: 0x00007E24
261 public byte[] EncryptedData
262 {
263 get
264 {
265 object obj;
266 if (this._data == null || obj == null || obj != null)
267 {
268 }
269 throw new InvalidCastException();
270 }
271 set
272 {
273 long num;
274 if (value != null)
275 {
276 object obj;
277 if (obj != null && obj == null)
278 {
279 throw new InvalidCastException();
280 }
281 }
282 else
283 {
284 num = 0L;
285 }
286 this._data = num;
287 }
288 }
289
290 // Token: 0x170000B5 RID: 181
291 // (get) Token: 0x0600027B RID: 635 RVA: 0x00009C4C File Offset: 0x00007E4C
292 public byte[] Salt
293 {
294 get
295 {
296 if (this._salt == null)
297 {
299 byte[] salt = this._salt;
300 }
301 object obj;
302 if (obj == null || obj != null)
303 {
304 }
305 throw new InvalidCastException();
306 }
307 }
308
309 // Token: 0x170000B6 RID: 182
310 // (get) Token: 0x0600027C RID: 636 RVA: 0x00009C7C File Offset: 0x00007E7C
311 // (set) Token: 0x0600027D RID: 637 RVA: 0x00009C90 File Offset: 0x00007E90
312 public int IterationCount
313 {
314 get
315 {
316 return this._iterations;
317 }
318 set
319 {
321 }
322 }
323
324 // Token: 0x0600027E RID: 638 RVA: 0x00009CA4 File Offset: 0x00007EA4
325 private void Decode(byte[] data)
326 {
327 ASN1 asn;
328 byte nTag = asn.m_nTag;
329 long num = 0L;
330 ASN1 asn2 = asn[(int)num];
331 byte nTag2 = asn2.m_nTag;
332 string text = ASN1Convert.ToOid(asn2);
334 int count = asn.Count;
335 byte nTag3 = asn[1].m_nTag;
336 ASN1 asn3;
337 byte nTag4 = asn3.m_nTag;
338 byte[] value = asn3.Value;
340 ASN1 asn4;
341 byte nTag5 = asn4.m_nTag;
344 ASN1 asn5;
345 byte nTag6 = asn5.m_nTag;
346 byte[] value2 = asn5.Value;
348 }
349
350 // Token: 0x0600027F RID: 639 RVA: 0x00009D4C File Offset: 0x00007F4C
351 public byte[] GetBytes()
352 {
353 /*
354An exception occurred when decompiling this method (0600027F)
355
356ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] Mono.Security.Cryptography.PKCS8/EncryptedPrivateKeyInfo::GetBytes()
357
358 ---> System.Exception: Basic block has to end with unconditional control flow.
359{
360 IL_002F:
361 stloc:uint8[](var_7_35, ldfld:uint8[](EncryptedPrivateKeyInfo::_data, ldloc:EncryptedPrivateKeyInfo(this)))
362}
363
364 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
365 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
366 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
367 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
368 --- End of inner exception stack trace ---
369 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
370 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
371*/;
372 }
373
374 // Token: 0x04000267 RID: 615
375 private string _algorithm;
376
377 // Token: 0x04000268 RID: 616
378 private byte[] _salt;
379
380 // Token: 0x04000269 RID: 617
381 private int _iterations;
382
383 // Token: 0x0400026A RID: 618
384 private byte[] _data;
385 }
386 }
387}
class f__AnonymousType0<< Count > j__TPar
static string ToOid(ASN1 asn1)
static int ToInt32(ASN1 asn1)
static ASN1 FromOid(string oid)
byte[] Value
Definition ASN1.cs:89
static byte[] RemoveLeadingZero(byte[] bigInt)
Definition PKCS8.cs:129
static byte[] Encode(AsymmetricAlgorithm aa)
Definition PKCS8.cs:210
static byte[] Normalize(byte[] bigInt, int length)
Definition PKCS8.cs:134
static DSA DecodeDSA(byte[] privateKey, DSAParameters dsaParameters)
Definition PKCS8.cs:194
static RSA DecodeRSA(byte[] keypair)
Definition PKCS8.cs:141
static new DSA Create()
Definition DSA.cs:18
static new RSA Create()
Definition RSA.cs:18