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
RSACryptoServiceProvider.cs
Go to the documentation of this file.
1using System;
2using System.IO;
6
8{
9 // Token: 0x020002F4 RID: 756
10 [ComVisible(true)]
12 {
13 // Token: 0x170002BB RID: 699
14 // (get) Token: 0x06001978 RID: 6520 RVA: 0x00036C70 File Offset: 0x00034E70
15 public override string SignatureAlgorithm
16 {
17 get
18 {
19 return "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
20 }
21 }
22
23 // Token: 0x170002BC RID: 700
24 // (get) Token: 0x06001979 RID: 6521 RVA: 0x0000207A File Offset: 0x0000027A
25 // (set) Token: 0x0600197A RID: 6522 RVA: 0x00036C84 File Offset: 0x00034E84
26 public static bool UseMachineKeyStore
27 {
28 get
29 {
30 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
31 }
32 set
33 {
34 }
35 }
36
37 // Token: 0x0600197B RID: 6523 RVA: 0x00036C94 File Offset: 0x00034E94
38 protected override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm)
39 {
42 }
43
44 // Token: 0x0600197C RID: 6524 RVA: 0x00036CAC File Offset: 0x00034EAC
45 protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm)
46 {
48 return hashAlgorithm2.ComputeHash(data);
49 }
50
51 // Token: 0x0600197D RID: 6525 RVA: 0x00036CC0 File Offset: 0x00034EC0
52 private static int GetAlgorithmId(HashAlgorithmName hashAlgorithm)
53 {
54 bool flag = "SHA512" == "MD5";
55 return 32771;
56 }
57
58 // Token: 0x0600197E RID: 6526 RVA: 0x00036D00 File Offset: 0x00034F00
59 public override byte[] Encrypt(byte[] data, RSAEncryptionPadding padding)
60 {
61 if (data != null)
62 {
63 if (!true)
64 {
65 }
66 if (!true)
67 {
68 }
69 if (!true)
70 {
71 }
72 if (!true)
73 {
74 }
75 if (!true)
76 {
77 }
78 return this.Encrypt(data, true);
79 }
80 return "data";
81 }
82
83 // Token: 0x0600197F RID: 6527 RVA: 0x00036D34 File Offset: 0x00034F34
84 public override byte[] Decrypt(byte[] data, RSAEncryptionPadding padding)
85 {
86 if (data != null)
87 {
88 if (!true)
89 {
90 }
91 if (!true)
92 {
93 }
94 if (!true)
95 {
96 }
97 byte[] array;
98 return array;
99 }
100 return "data";
101 }
102
103 // Token: 0x06001980 RID: 6528 RVA: 0x00036D5C File Offset: 0x00034F5C
104 public override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
105 {
106 if (hash != null)
107 {
108 if (!true)
109 {
110 }
111 if (!true)
112 {
113 }
114 if (!true)
115 {
116 }
118 return this.SignHash(hash, algorithmId);
119 }
120 return "hash";
121 }
122
123 // Token: 0x06001981 RID: 6529 RVA: 0x00036D98 File Offset: 0x00034F98
124 public override bool VerifyHash(byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
125 {
126 if (hash == null)
127 {
128 return "hash" != null;
129 }
130 if (signature != null)
131 {
132 if (!true)
133 {
134 }
135 if (!true)
136 {
137 }
138 if (!true)
139 {
140 }
142 return this.VerifyHash(hash, algorithmId, signature);
143 }
144 return "signature" != null;
145 }
146
147 // Token: 0x06001982 RID: 6530 RVA: 0x00036DE0 File Offset: 0x00034FE0
149 {
150 /*
151An exception occurred when decompiling this method (06001982)
152
153ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Exception System.Security.Cryptography.RSACryptoServiceProvider::PaddingModeNotSupported()
154
155 ---> System.Exception: Basic block has to end with unconditional control flow.
156{
157 Block_0:
158 stloc:string(var_0_0A, call:string(Environment::GetResourceString, ldstr:string("Specified padding mode is not valid for this algorithm.")))
159}
160
161 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
162 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
163 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
164 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
165 --- End of inner exception stack trace ---
166 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
167 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
168*/;
169 }
170
171 // Token: 0x06001983 RID: 6531 RVA: 0x00036DF8 File Offset: 0x00034FF8
173 {
175 base..ctor();
176 long num = 0L;
177 this.Common(1024, num != 0L);
178 }
179
180 // Token: 0x06001984 RID: 6532 RVA: 0x00036E20 File Offset: 0x00035020
182 {
183 }
184
185 // Token: 0x06001985 RID: 6533 RVA: 0x00036E30 File Offset: 0x00035030
187 {
189 base..ctor();
190 long num = 0L;
191 this.Common(dwKeySize, num != 0L);
192 }
193
194 // Token: 0x06001986 RID: 6534 RVA: 0x00036E54 File Offset: 0x00035054
196 {
198 base..ctor();
199 if (parameters != null)
200 {
201 this.Common(parameters);
202 return;
203 }
204 }
205
206 // Token: 0x06001987 RID: 6535 RVA: 0x00036E7C File Offset: 0x0003507C
207 private void Common(int dwKeySize, bool parameters)
208 {
210 bool useMachineKeyStore = RSACryptoServiceProvider.UseMachineKeyStore;
211 }
212
213 // Token: 0x06001988 RID: 6536 RVA: 0x00036E9C File Offset: 0x0003509C
214 private void Common(CspParameters p)
215 {
216 int flags = p.m_flags;
218 if (this.store._keyvalue != null)
219 {
220 this.persisted = true;
221 return;
222 }
223 }
224
225 // Token: 0x06001989 RID: 6537 RVA: 0x00036ECC File Offset: 0x000350CC
226 protected override void Finalize()
227 {
228 base.Finalize();
229 }
230
231 // Token: 0x170002BD RID: 701
232 // (get) Token: 0x0600198A RID: 6538 RVA: 0x00036F00 File Offset: 0x00035100
233 public override string KeyExchangeAlgorithm
234 {
235 get
236 {
237 return "RSA-PKCS1-KeyEx";
238 }
239 }
240
241 // Token: 0x170002BE RID: 702
242 // (get) Token: 0x0600198B RID: 6539 RVA: 0x00036F14 File Offset: 0x00035114
243 public override int KeySize
244 {
245 get
246 {
247 /*
248An exception occurred when decompiling this method (0600198B)
249
250ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 System.Security.Cryptography.RSACryptoServiceProvider::get_KeySize()
251
252 ---> System.Exception: Basic block has to end with unconditional control flow.
253{
254 IL_0000:
255 brtrue(IL_0000, logicnot:bool(ldfld:RSAManaged[exp:bool](RSACryptoServiceProvider::rsa, ldloc:RSACryptoServiceProvider(this))))
256}
257
258 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
259 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
260 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
261 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
262 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
263 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
264 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
265 --- End of inner exception stack trace ---
266 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
267 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
268*/;
269 }
270 }
271
272 // Token: 0x170002BF RID: 703
273 // (get) Token: 0x0600198C RID: 6540 RVA: 0x00036F28 File Offset: 0x00035128
274 // (set) Token: 0x0600198D RID: 6541 RVA: 0x00036F3C File Offset: 0x0003513C
275 public bool PersistKeyInCsp
276 {
277 get
278 {
279 return this.persistKey;
280 }
281 set
282 {
283 }
284 }
285
286 // Token: 0x170002C0 RID: 704
287 // (get) Token: 0x0600198E RID: 6542 RVA: 0x00036F4C File Offset: 0x0003514C
288 [ComVisible(false)]
289 public bool PublicOnly
290 {
291 get
292 {
293 return this.rsa.PublicOnly;
294 }
295 }
296
297 // Token: 0x0600198F RID: 6543 RVA: 0x00036F64 File Offset: 0x00035164
298 public byte[] Decrypt(byte[] rgb, bool fOAEP)
299 {
300 while (rgb != null)
301 {
302 if (!this.m_disposed)
303 {
305 break;
306 }
307 }
308 throw new ArrayTypeMismatchException();
309 }
310
311 // Token: 0x06001990 RID: 6544 RVA: 0x00036F8C File Offset: 0x0003518C
312 public override byte[] DecryptValue(byte[] rgb)
313 {
314 /*
315An exception occurred when decompiling this method (06001990)
316
317ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] System.Security.Cryptography.RSACryptoServiceProvider::DecryptValue(System.Byte[])
318
319 ---> System.Exception: Basic block has to end with unconditional control flow.
320{
321 Block_0:
322 stloc:bool(var_0_0B, callgetter:bool(RSAManaged::get_IsCrtPossible, ldfld:RSAManaged(RSACryptoServiceProvider::rsa, ldloc:RSACryptoServiceProvider(this))))
323 stloc:RSAManaged(var_1_12, ldfld:RSAManaged(RSACryptoServiceProvider::rsa, ldloc:RSACryptoServiceProvider(this)))
324}
325
326 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
327 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
328 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
329 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
330 --- End of inner exception stack trace ---
331 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
332 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
333*/;
334 }
335
336 // Token: 0x06001991 RID: 6545 RVA: 0x00036FAC File Offset: 0x000351AC
337 public byte[] Encrypt(byte[] rgb, bool fOAEP)
338 {
339 /*
340An exception occurred when decompiling this method (06001991)
341
342ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] System.Security.Cryptography.RSACryptoServiceProvider::Encrypt(System.Byte[],System.Boolean)
343
344 ---> System.Exception: Basic block has to end with unconditional control flow.
345{
346 Block_0:
347 stloc:RSAManaged(var_0_06, ldfld:RSAManaged(RSACryptoServiceProvider::rsa, ldloc:RSACryptoServiceProvider(this)))
348}
349
350 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
351 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
352 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
353 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
354 --- End of inner exception stack trace ---
355 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
356 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
357*/;
358 }
359
360 // Token: 0x06001992 RID: 6546 RVA: 0x00036FC0 File Offset: 0x000351C0
361 public override byte[] EncryptValue(byte[] rgb)
362 {
363 /*
364An exception occurred when decompiling this method (06001992)
365
366ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Byte[] System.Security.Cryptography.RSACryptoServiceProvider::EncryptValue(System.Byte[])
367
368 ---> System.Exception: Basic block has to end with unconditional control flow.
369{
370 Block_0:
371 stloc:RSAManaged(var_0_06, ldfld:RSAManaged(RSACryptoServiceProvider::rsa, ldloc:RSACryptoServiceProvider(this)))
372}
373
374 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
375 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
376 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
377 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
378 --- End of inner exception stack trace ---
379 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
380 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
381*/;
382 }
383
384 // Token: 0x06001993 RID: 6547 RVA: 0x00036FD4 File Offset: 0x000351D4
386 {
387 /*
388An exception occurred when decompiling this method (06001993)
389
390ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Security.Cryptography.RSAParameters System.Security.Cryptography.RSACryptoServiceProvider::ExportParameters(System.Boolean)
391
392 ---> System.Exception: Basic block has to end with unconditional control flow.
393{
394 Block_0:
395 stloc:RSAManaged(var_1_0E, ldfld:RSAManaged(RSACryptoServiceProvider::rsa, ldloc:RSACryptoServiceProvider(this)))
396}
397
398 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
399 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
400 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
401 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
402 --- End of inner exception stack trace ---
403 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
404 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
405*/;
406 }
407
408 // Token: 0x06001994 RID: 6548 RVA: 0x00036FF0 File Offset: 0x000351F0
409 public override void ImportParameters(RSAParameters parameters)
410 {
411 byte[] dp = parameters.DP;
412 byte[] exponent = parameters.Exponent;
414 }
415
416 // Token: 0x06001995 RID: 6549 RVA: 0x00037014 File Offset: 0x00035214
417 private HashAlgorithm GetHash(object halg)
418 {
419 for (;;)
420 {
421 if (halg != null)
422 {
423 object obj;
424 if (obj != null)
425 {
426 break;
427 }
428 HashAlgorithm hashAlgorithm;
429 if (hashAlgorithm != null)
430 {
431 return hashAlgorithm;
432 }
433 }
434 }
435 throw new InvalidCastException();
436 }
437
438 // Token: 0x06001996 RID: 6550 RVA: 0x00037034 File Offset: 0x00035234
440 {
441 HashAlgorithm hashAlgorithm;
442 if (HashAlgorithm.Create(name) == null)
443 {
444 string text;
445 hashAlgorithm = HashAlgorithm.Create(text);
446 }
447 return hashAlgorithm;
448 }
449
450 // Token: 0x06001997 RID: 6551 RVA: 0x00037058 File Offset: 0x00035258
451 public byte[] SignData(byte[] buffer, object halg)
452 {
453 while (buffer == null)
454 {
455 }
456 byte[] array;
457 return array;
458 }
459
460 // Token: 0x06001998 RID: 6552 RVA: 0x0003706C File Offset: 0x0003526C
461 public byte[] SignData(Stream inputStream, object halg)
462 {
463 HashAlgorithm hash = this.GetHash(halg);
464 byte[] array = hash.ComputeHash(inputStream);
465 return PKCS1.Sign_v15(this, hash, array);
466 }
467
468 // Token: 0x06001999 RID: 6553 RVA: 0x00037094 File Offset: 0x00035294
469 public byte[] SignData(byte[] buffer, int offset, int count, object halg)
470 {
471 HashAlgorithm hash = this.GetHash(halg);
472 byte[] array = hash.ComputeHash(buffer, offset, count);
473 return PKCS1.Sign_v15(this, hash, array);
474 }
475
476 // Token: 0x0600199A RID: 6554 RVA: 0x000370BC File Offset: 0x000352BC
477 private string GetHashNameFromOID(string oid)
478 {
479 bool flag = oid == "1.3.14.3.2.26";
480 bool flag2 = oid == "1.2.840.113549.2.5";
481 bool flag3 = oid == "2.16.840.1.101.3.4.2.1";
482 bool flag4 = oid == "2.16.840.1.101.3.4.2.2";
483 bool flag5 = oid == "2.16.840.1.101.3.4.2.3";
484 return "SHA512";
485 }
486
487 // Token: 0x0600199B RID: 6555 RVA: 0x00037118 File Offset: 0x00035318
488 public byte[] SignHash(byte[] rgbHash, string str)
489 {
490 while (rgbHash == null)
491 {
492 }
493 if (str != null)
494 {
495 }
496 HashAlgorithm hashAlgorithm = HashAlgorithm.Create("SHA1");
497 return PKCS1.Sign_v15(this, hashAlgorithm, rgbHash);
498 }
499
500 // Token: 0x0600199C RID: 6556 RVA: 0x00037140 File Offset: 0x00035340
501 private byte[] SignHash(byte[] rgbHash, int calgHash)
502 {
504 return PKCS1.Sign_v15(this, hashAlgorithm, rgbHash);
505 }
506
507 // Token: 0x0600199D RID: 6557 RVA: 0x0003715C File Offset: 0x0003535C
509 {
510 /*
511An exception occurred when decompiling this method (0600199D)
512
513ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Security.Cryptography.HashAlgorithm System.Security.Cryptography.RSACryptoServiceProvider::InternalHashToHashAlgorithm(System.Int32)
514
515 ---> System.Exception: Basic block has to end with unconditional control flow.
516{
517 Block_0:
518 stloc:MD5(var_1_07, call:MD5(MD5::Create))
519 stloc:SHA1(var_2_0D, call:SHA1(SHA1::Create))
520 stloc:SHA384(var_3_13, call:SHA384(SHA384::Create))
521 stloc:SHA256(var_4_19, call:SHA256(SHA256::Create))
522 stloc:SHA512(var_5_20, call:SHA512(SHA512::Create))
523}
524
525 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
526 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
527 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
528 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
529 --- End of inner exception stack trace ---
530 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
531 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
532*/;
533 }
534
535 // Token: 0x0600199E RID: 6558 RVA: 0x0003718C File Offset: 0x0003538C
536 public bool VerifyData(byte[] buffer, object halg, byte[] signature)
537 {
538 while (buffer != null)
539 {
540 if (signature != null)
541 {
542 HashAlgorithm hash = this.GetHash(halg);
543 byte[] array = hash.ComputeHash(buffer);
544 return PKCS1.Verify_v15(this, hash, array, signature);
545 }
546 }
547 return "buffer" != null;
548 }
549
550 // Token: 0x0600199F RID: 6559 RVA: 0x000371C0 File Offset: 0x000353C0
551 public bool VerifyHash(byte[] rgbHash, string str, byte[] rgbSignature)
552 {
553 while (rgbHash != null)
554 {
555 if (rgbSignature != null)
556 {
557 if (str != null)
558 {
559 }
560 HashAlgorithm hashAlgorithm = HashAlgorithm.Create("SHA1");
561 return PKCS1.Verify_v15(this, hashAlgorithm, rgbHash, rgbSignature);
562 }
563 }
564 return "rgbHash" != null;
565 }
566
567 // Token: 0x060019A0 RID: 6560 RVA: 0x000371F0 File Offset: 0x000353F0
568 private bool VerifyHash(byte[] rgbHash, int calgHash, byte[] rgbSignature)
569 {
571 return PKCS1.Verify_v15(this, hashAlgorithm, rgbHash, rgbSignature);
572 }
573
574 // Token: 0x060019A1 RID: 6561 RVA: 0x00037210 File Offset: 0x00035410
575 protected override void Dispose(bool disposing)
576 {
577 if (!this.m_disposed)
578 {
579 if (this.persisted && !this.persistKey)
580 {
581 this.store.Remove();
582 }
584 if (rsamanaged != null)
585 {
587 }
588 this.m_disposed = true;
589 }
590 }
591
592 // Token: 0x060019A2 RID: 6562 RVA: 0x00037258 File Offset: 0x00035458
593 private void OnKeyGenerated(object sender, EventArgs e)
594 {
595 if (this.persistKey && !this.persisted)
596 {
599 bool publicOnly = rsamanaged.PublicOnly;
600 this.store.Save();
601 this.persisted = true;
602 }
603 }
604
605 // Token: 0x170002C1 RID: 705
606 // (get) Token: 0x060019A3 RID: 6563 RVA: 0x0003729C File Offset: 0x0003549C
607 [ComVisible(false)]
609 {
610 get
611 {
612 /*
613An exception occurred when decompiling this method (060019A3)
614
615ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Security.Cryptography.CspKeyContainerInfo System.Security.Cryptography.RSACryptoServiceProvider::get_CspKeyContainerInfo()
616
617 ---> System.Exception: Basic block has to end with unconditional control flow.
618{
619 Block_0:
620 stloc:CspParameters(var_0_0B, callgetter:CspParameters(KeyPairPersistence::get_Parameters, ldfld:KeyPairPersistence(RSACryptoServiceProvider::store, ldloc:RSACryptoServiceProvider(this))))
621}
622
623 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
624 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
625 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
626 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
627 --- End of inner exception stack trace ---
628 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
629 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
630*/;
631 }
632 }
633
634 // Token: 0x060019A4 RID: 6564 RVA: 0x000372B4 File Offset: 0x000354B4
635 [ComVisible(false)]
637 {
639 }
640
641 // Token: 0x060019A5 RID: 6565 RVA: 0x000372E0 File Offset: 0x000354E0
642 [ComVisible(false)]
643 public void ImportCspBlob(byte[] keyBlob)
644 {
645 if (keyBlob == null)
646 {
647 return;
648 }
650 {
651 return;
652 }
653 bool useMachineKeyStore = RSACryptoServiceProvider.UseMachineKeyStore;
654 }
655
656 // Token: 0x04000CFD RID: 3325
658
659 // Token: 0x04000CFE RID: 3326
660 private const int PROV_RSA_FULL = 1;
661
662 // Token: 0x04000CFF RID: 3327
663 private const int AT_KEYEXCHANGE = 1;
664
665 // Token: 0x04000D00 RID: 3328
666 private const int AT_SIGNATURE = 2;
667
668 // Token: 0x04000D01 RID: 3329
670
671 // Token: 0x04000D02 RID: 3330
672 private bool persistKey;
673
674 // Token: 0x04000D03 RID: 3331
675 private bool persisted;
676
677 // Token: 0x04000D04 RID: 3332
679
680 // Token: 0x04000D05 RID: 3333
681 private bool m_disposed;
682
683 // Token: 0x04000D06 RID: 3334
685 }
686}
class f__AnonymousType0<< Count > j__TPar
static byte[] ToCapiPrivateKeyBlob(RSA rsa)
static bool Verify_v15(RSA rsa, HashAlgorithm hash, byte[] hashValue, byte[] signature, bool tryNonStandardEncoding)
Definition PKCS1.cs:55
static byte[] Sign_v15(RSA rsa, HashAlgorithm hash, byte[] hashValue)
Definition PKCS1.cs:110
override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
byte[] SignData(byte[] buffer, int offset, int count, object halg)
override bool VerifyHash(byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
bool VerifyData(byte[] buffer, object halg, byte[] signature)
override byte[] Encrypt(byte[] data, RSAEncryptionPadding padding)
RSACryptoServiceProvider(int dwKeySize, CspParameters parameters)
override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm)
override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm)
override RSAParameters ExportParameters(bool includePrivateParameters)
bool VerifyHash(byte[] rgbHash, string str, byte[] rgbSignature)
bool VerifyHash(byte[] rgbHash, int calgHash, byte[] rgbSignature)
override byte[] Decrypt(byte[] data, RSAEncryptionPadding padding)
static int GetAlgorithmId(HashAlgorithmName hashAlgorithm)