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
PKCS12.cs
Go to the documentation of this file.
1using System;
3using System.IO;
7
8namespace Mono.Security.X509
9{
10 // Token: 0x0200000E RID: 14
11 public class PKCS12 : ICloneable
12 {
13 // Token: 0x06000049 RID: 73 RVA: 0x00002CF8 File Offset: 0x00000EF8
14 public PKCS12()
15 {
16 this._iterations = 2000;
17 }
18
19 // Token: 0x0600004A RID: 74 RVA: 0x00002D18 File Offset: 0x00000F18
20 public PKCS12(byte[] data)
21 {
22 this.Decode(data);
23 }
24
25 // Token: 0x0600004B RID: 75 RVA: 0x00002D2C File Offset: 0x00000F2C
26 public PKCS12(byte[] data, string password)
27 {
28 this.Password = password;
29 this.Decode(data);
30 }
31
32 // Token: 0x0600004C RID: 76 RVA: 0x00002D48 File Offset: 0x00000F48
33 public PKCS12(byte[] data, byte[] password)
34 {
35 this._password = password;
36 this.Decode(data);
37 }
38
39 // Token: 0x0600004D RID: 77 RVA: 0x00002D64 File Offset: 0x00000F64
40 private void Decode(byte[] data)
41 {
42 ASN1 asn;
43 byte nTag = asn.m_nTag;
44 bool flag;
45 if (flag)
46 {
47 ASN1 asn2;
48 byte nTag2 = asn2.m_nTag;
49 long num = 0L;
50 byte nTag3 = asn2[(int)num].m_nTag;
51 long num2 = 0L;
52 ASN1 asn3;
53 bool flag2 = ASN1Convert.ToOid(asn3[(int)num2]) != "1.3.14.3.2.26";
54 int num3 = 1;
55 ASN1 asn4;
56 byte[] value = asn4.Value;
57 int num4 = 1;
58 ASN1 asn5 = asn2[num4];
59 byte nTag4 = asn5.m_nTag;
61 if (asn2.elist != null)
62 {
63 int num5 = 2;
64 ASN1 asn6 = asn2[num5];
65 byte nTag5 = asn6.m_nTag;
68 }
69 ASN1 asn7;
70 byte[] value2 = asn7.Value;
71 byte[] password = this._password;
72 byte[] value3 = asn5.Value;
73 int iterations = this._iterations;
74 return;
75 }
76 ASN1 asn8;
77 byte[] value4 = asn8.Value;
78 ASN1 asn9;
79 byte[] value5 = asn9.Value;
80 }
81
82 // Token: 0x0600004E RID: 78 RVA: 0x00002E9C File Offset: 0x0000109C
83 protected override void Finalize()
84 {
85 if (this._password != null)
86 {
87 }
88 base.Finalize();
89 }
90
91 // Token: 0x17000018 RID: 24
92 // (set) Token: 0x0600004F RID: 79 RVA: 0x00002ED8 File Offset: 0x000010D8
93 public string Password
94 {
95 set
96 {
97 int num = 1;
98 long num2;
99 if (this._password != null)
100 {
101 num2 = 0L;
102 }
103 if (value != null)
104 {
105 int stringLength = value._stringLength;
106 if (num == 0)
107 {
108 }
109 if (!true)
110 {
111 }
112 char c = value[(int)num2];
113 return;
114 }
115 }
116 }
117
118 // Token: 0x17000019 RID: 25
119 // (get) Token: 0x06000050 RID: 80 RVA: 0x00002F2C File Offset: 0x0000112C
120 // (set) Token: 0x06000051 RID: 81 RVA: 0x00002F40 File Offset: 0x00001140
121 public int IterationCount
122 {
123 get
124 {
125 return this._iterations;
126 }
127 set
128 {
130 }
131 }
132
133 // Token: 0x1700001A RID: 26
134 // (get) Token: 0x06000052 RID: 82 RVA: 0x00002F54 File Offset: 0x00001154
136 {
137 get
138 {
139 if (this._keyBagsChanged)
140 {
142 return this._safeBags;
143 }
146 }
147 }
148
149 // Token: 0x1700001B RID: 27
150 // (get) Token: 0x06000053 RID: 83 RVA: 0x00003050 File Offset: 0x00001250
152 {
153 get
154 {
155 if (this._secretBagsChanged)
156 {
158 return this._safeBags;
159 }
162 }
163 }
164
165 // Token: 0x1700001C RID: 28
166 // (get) Token: 0x06000054 RID: 84 RVA: 0x000030E8 File Offset: 0x000012E8
168 {
169 get
170 {
171 while (this._certsChanged)
172 {
173 this._certs.Clear();
175 if (safeBags != null)
176 {
177 }
178 object[] items = safeBags._items;
179 int size = safeBags._size;
180 ASN1 asn;
181 byte[] value = asn.Value;
183 ASN1 asn2;
184 byte[] value2 = asn2.Value;
185 long num = 0L;
186 int num2 = 5;
187 if (safeBags != null)
188 {
189 }
190 if (num != 0L)
191 {
192 throw new OutOfMemoryException();
193 }
194 if (num2 == 0)
195 {
196 break;
197 }
198 }
199 return this._certs;
200 }
201 }
202
203 // Token: 0x1700001D RID: 29
204 // (get) Token: 0x06000055 RID: 85 RVA: 0x00003174 File Offset: 0x00001374
206 {
207 get
208 {
210 if (this._rng == null)
211 {
212 randomNumberGenerator = RandomNumberGenerator.Create();
214 }
216 }
217 }
218
219 // Token: 0x06000056 RID: 86 RVA: 0x00003198 File Offset: 0x00001398
220 private bool Compare(byte[] expected, byte[] actual)
221 {
222 }
223
224 // Token: 0x06000057 RID: 87 RVA: 0x000031A8 File Offset: 0x000013A8
226 {
227 byte[] password = this._password;
228 uint num = <PrivateImplementationDetails>.ComputeStringHash(algorithmOid);
229 bool flag = algorithmOid == "1.2.840.113549.1.5.11";
230 bool flag2 = algorithmOid == "1.2.840.113549.1.5.1";
231 bool flag3 = algorithmOid == "1.2.840.113549.1.12.1.2";
233 if (8 != 0)
234 {
235 }
236 return symmetricAlgorithm;
237 }
238
239 // Token: 0x06000058 RID: 88 RVA: 0x00003200 File Offset: 0x00001400
240 public byte[] Decrypt(string algorithmOid, byte[] salt, int iterationCount, byte[] encryptedData)
241 {
243 long num = 0L;
244 if (symmetricAlgorithm != null)
245 {
246 symmetricAlgorithm.Clear();
247 }
248 if (num == 0L)
249 {
250 }
251 throw new OutOfMemoryException();
252 }
253
254 // Token: 0x06000059 RID: 89 RVA: 0x0000324C File Offset: 0x0000144C
256 {
257 PKCS7.ContentInfo encryptionAlgorithm = ed._encryptionAlgorithm;
258 long num = 0L;
259 string contentType = encryptionAlgorithm.contentType;
260 byte[] value = encryptionAlgorithm.content[(int)num].Value;
261 int num2 = ASN1Convert.ToInt32(ed._encryptionAlgorithm.content[1]);
262 byte[] encryptedContent = ed.EncryptedContent;
263 return this.Decrypt(contentType, value, num2, encryptedContent);
264 }
265
266 // Token: 0x0600005A RID: 90 RVA: 0x000032A8 File Offset: 0x000014A8
267 public byte[] Encrypt(string algorithmOid, byte[] salt, int iterationCount, byte[] data)
268 {
270 long num = 0L;
271 if (symmetricAlgorithm != null)
272 {
273 }
274 if (num == 0L)
275 {
276 }
277 throw new OutOfMemoryException();
278 }
279
280 // Token: 0x0600005B RID: 91 RVA: 0x000032EC File Offset: 0x000014EC
282 {
285 do
286 {
287 enumerator = this.Certificates.GetEnumerator();
288 bool flag = enumerator.MoveNext();
289 x509Certificate = enumerator.Current;
290 while (x509Certificate == null)
291 {
292 }
293 }
294 while (x509Certificate.DSA == null);
295 int num = 1;
296 found.m_value = num != 0;
297 long num2 = 0L;
298 int num3 = 5;
299 if (enumerator != null)
300 {
301 }
302 if (num2 != 0L || num3 == 0)
303 {
304 }
305 throw new OutOfMemoryException();
306 }
307
308 // Token: 0x0600005C RID: 92 RVA: 0x00003350 File Offset: 0x00001550
310 {
311 byte[] privateKey = pki.PrivateKey;
312 string algorithm = pki._algorithm;
313 bool flag = algorithm == "1.2.840.113549.1.1.1";
316 }
317
318 // Token: 0x0600005D RID: 93 RVA: 0x000033EC File Offset: 0x000015EC
320 {
321 byte nTag = safeBag.m_nTag;
322 long num = 0L;
323 ASN1 asn = safeBag[(int)num];
324 byte nTag2 = asn.m_nTag;
325 int num2 = 1;
327 bool flag = ASN1Convert.ToOid(asn) == "1.2.840.113549.1.12.10.1.1";
328 byte[] value = asn2.Value;
329 }
330
331 // Token: 0x0600005E RID: 94 RVA: 0x00003504 File Offset: 0x00001704
333 {
334 int iterations = this._iterations;
335 int iterations2 = this._iterations;
336 byte[] array2;
337 byte[] array3;
338 byte[] array = this.Encrypt("1.2.840.113549.1.12.1.3", array2, iterations2, array3);
339 ASN1 asn = ASN1Convert.FromOid("1.2.840.113549.1.12.10.1.2");
340 if (attributes != null)
341 {
342 if (attributes != null)
343 {
344 }
345 ASN1 asn2 = ASN1Convert.FromOid("1.2.840.113549.1.9.20");
346 if (attributes == null || attributes == null)
347 {
348 }
349 ASN1 asn3;
350 return asn3;
351 }
352 ASN1 asn4;
353 return asn4;
354 }
355
356 // Token: 0x0600005F RID: 95 RVA: 0x000035CC File Offset: 0x000017CC
358 {
359 ASN1 asn = ASN1Convert.FromOid("1.2.840.113549.1.12.10.1.1");
360 if (attributes != null)
361 {
362 if (attributes != null)
363 {
364 }
365 ASN1 asn2 = ASN1Convert.FromOid("1.2.840.113549.1.9.20");
366 if (attributes == null || attributes == null)
367 {
368 }
369 ASN1 asn3;
370 return asn3;
371 }
372 ASN1 asn4;
373 return asn4;
374 }
375
376 // Token: 0x06000060 RID: 96 RVA: 0x00003680 File Offset: 0x00001880
377 private ASN1 SecretBagSafeBag(byte[] secret, IDictionary attributes)
378 {
379 ASN1 asn = ASN1Convert.FromOid("1.2.840.113549.1.12.10.1.5");
380 if (attributes != null)
381 {
382 if (attributes != null)
383 {
384 }
385 ASN1 asn2 = ASN1Convert.FromOid("1.2.840.113549.1.9.20");
386 if (attributes == null || attributes == null)
387 {
388 }
389 ASN1 asn3;
390 return asn3;
391 }
392 ASN1 asn4;
393 return asn4;
394 }
395
396 // Token: 0x06000061 RID: 97 RVA: 0x00003728 File Offset: 0x00001928
398 {
399 ASN1 asn = ASN1Convert.FromOid("1.2.840.113549.1.12.10.1.3");
400 if (attributes != null)
401 {
402 if (attributes != null)
403 {
404 }
405 ASN1 asn2 = ASN1Convert.FromOid("1.2.840.113549.1.9.20");
406 if (attributes == null || attributes == null)
407 {
408 }
409 ASN1 asn3;
410 return asn3;
411 }
412 ASN1 asn4;
413 return asn4;
414 }
415
416 // Token: 0x06000062 RID: 98 RVA: 0x000037D0 File Offset: 0x000019D0
417 private byte[] MAC(byte[] password, byte[] salt, int iterations, byte[] data)
418 {
419 HMAC hmac = HMAC.Create();
420 if (hmac != null)
421 {
422 }
423 long num = 0L;
424 return hmac.ComputeHash(data, (int)num, iterations);
425 }
426
427 // Token: 0x06000063 RID: 99 RVA: 0x00003800 File Offset: 0x00001A00
428 public byte[] GetBytes()
429 {
430 ASN1 asn;
431 byte[] value = asn.Value;
432 ASN1 asn2;
433 byte[] value2 = asn2.Value;
434 if (!false)
435 {
438 long num = 0L;
439 if (num != 0L)
440 {
441 }
442 if (num != 0L)
443 {
444 }
446 byte[] encodedcert = x509Certificate.m_encodedcert;
447 long num2 = 0L;
448 int num3 = 9;
449 if (num != 0L)
450 {
451 }
452 if (num2 != 0L)
453 {
454 throw new OutOfMemoryException();
455 }
456 if (num3 == 0)
457 {
458 throw new InvalidCastException();
459 }
460 long num4 = 0L;
461 if (num != 0L)
462 {
463 }
464 if (num4 == 0L)
465 {
466 int num5;
467 if (num5 == 0)
468 {
469 if (num != 0L)
470 {
471 }
472 if (num != 0L)
473 {
474 }
477 long num6 = 0L;
478 bool flag = enumerator2.MoveNext();
479 byte[] encodedcert2 = enumerator2.Current.m_encodedcert;
480 long num7 = 0L;
481 int num8 = 15;
482 if (enumerator2 == null || num6 != 0L)
483 {
484 }
485 if (num7 != 0L)
486 {
487 throw new OutOfMemoryException();
488 }
489 if (num8 == 0)
490 {
491 }
492 long num9 = 0L;
493 if (num6 != 0L)
494 {
495 }
496 if (num9 == 0L)
497 {
498 if (num6 != 0L)
499 {
500 }
501 if (num6 != 0L)
502 {
503 }
504 long num10 = 0L;
505 int num11 = 19;
506 if (num10 == 0L)
507 {
508 if (num11 != 0)
509 {
510 goto IL_019F;
511 }
512 long num12 = 0L;
513 int num13 = 22;
514 if (num12 != 0L)
515 {
516 goto IL_020B;
517 }
518 if (num13 != 0)
519 {
520 goto IL_019F;
521 }
522 long num14 = 0L;
523 int num15 = 26;
524 if (num14 == 0L)
525 {
526 if (num15 != 0)
527 {
528 goto IL_019F;
529 }
530 if ("UI.SpawnPoint" != null)
531 {
532 PKCS7.ContentInfo contentInfo;
533 ASN1 asn3 = contentInfo.GetASN1();
534 ASN1 asn4 = asn3.Add(asn3);
535 }
536 long num16 = 0L;
537 int num17 = 31;
538 if (num16 == 0L)
539 {
540 if (num17 != 0)
541 {
542 goto IL_019F;
543 }
544 ASN1 asn6;
545 ASN1 asn5 = asn6.Add(asn6);
546 long num18 = 0L;
547 int num19 = 35;
548 if (num18 == 0L)
549 {
550 if (num19 != 0)
551 {
552 goto IL_019F;
553 }
555 ASN1 asn7 = contentInfo2.GetASN1();
556 ASN1 asn8 = asn7.Add(asn7);
557 if ("1.2.840.113549.1.7.1" != null)
558 {
560 ASN1 asn9;
561 byte[] value3 = asn9.Value;
562 ASN1 asn10 = ASN1Convert.FromOid("1.3.14.3.2.26");
563 }
564 ASN1 asn11;
565 if (asn11 != null)
566 {
567 goto IL_019F;
568 }
569 goto IL_019F;
570 }
571 }
572 }
573 }
574 throw new OutOfMemoryException();
575 }
576 throw new OutOfMemoryException();
577 }
578 IL_019F:
579 long num20 = 0L;
580 long num21 = 0L;
581 if (num20 != 0L)
582 {
583 long value4 = num20.m_value;
584 if (num20 != 0L)
585 {
586 throw new OutOfMemoryException();
587 }
588 long num22 = 0L;
589 long num23;
590 if (num23 != 0L)
591 {
592 long value5 = num23.m_value;
593 }
594 if (num22 != 0L)
595 {
596 throw new OutOfMemoryException();
597 }
598 }
599 else
600 {
601 if (num21 != 0L)
602 {
603 throw new OutOfMemoryException();
604 }
605 long num23 = 0L;
606 long num24;
607 if (num24 != 0L)
608 {
609 long value6 = num24.m_value;
610 }
611 if (num23 != 0L)
612 {
613 throw new OutOfMemoryException();
614 }
615 }
616 throw new OutOfMemoryException();
617 }
618 throw new OutOfMemoryException();
619 }
620 IL_020B:
621 throw new OutOfMemoryException();
622 }
623
624 // Token: 0x06000064 RID: 100 RVA: 0x00003AB8 File Offset: 0x00001CB8
626 {
627 /*
628An exception occurred when decompiling this method (06000064)
629
630ICSharpCode.Decompiler.DecompilerException: Error decompiling Mono.Security.PKCS7/ContentInfo Mono.Security.X509.PKCS12::EncryptedContentInfo(Mono.Security.ASN1,System.String)
631
632 ---> System.Exception: Basic block has to end with unconditional control flow.
633{
634 IL_0017:
635 stloc:ASN1(var_3_22, call:ASN1(ASN1Convert::FromInt32, ldfld:int32(PKCS12::_iterations, ldloc:PKCS12(this))))
636 stloc:ASN1(var_5_29, call:ASN1(ASN1Convert::FromOid, ldloc:string(algorithmOid)))
637 stloc:int32(var_8_31, ldfld:int32(PKCS12::_iterations, ldloc:PKCS12(this)))
638 stloc:ASN1(var_10_3D, call:ASN1(ASN1Convert::FromOid, ldstr:string("1.2.840.113549.1.7.1")))
639}
640
641 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
642 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
643 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
644 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
645 --- End of inner exception stack trace ---
646 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
647 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
648*/;
649 }
650
651 // Token: 0x06000065 RID: 101 RVA: 0x00003B04 File Offset: 0x00001D04
653 {
654 }
655
656 // Token: 0x06000066 RID: 102 RVA: 0x00003B14 File Offset: 0x00001D14
657 public void AddCertificate(X509Certificate cert, IDictionary attributes)
658 {
659 if ("1.2.840.113549.1.12.10.1.3" != null)
660 {
661 }
662 ASN1 asn;
663 byte[] value = asn.Value;
664 ASN1 asn2;
665 byte[] value2 = asn2.Value;
666 byte[] encodedcert = cert.m_encodedcert;
667 }
668
669 // Token: 0x06000067 RID: 103 RVA: 0x00003B54 File Offset: 0x00001D54
671 {
672 }
673
674 // Token: 0x06000068 RID: 104 RVA: 0x00003B64 File Offset: 0x00001D64
676 {
679 if (safeBags2 != null)
680 {
681 }
682 object[] items = safeBags2._items;
683 int size = safeBags2._size;
684 ASN1 asn;
685 byte[] value = asn.Value;
686 ASN1 asn2;
687 byte[] value2 = asn2.Value;
688 long num = 0L;
689 if (attrs != null)
690 {
691 long num2 = 0L;
692 ASN1 asn3;
693 if (asn3.elist != null)
694 {
695 }
696 ASN1 asn4 = asn3[(int)num2];
697 long num3 = 0L;
698 string text = ASN1Convert.ToOid(asn4[(int)num3]);
699 if (num != 0L)
700 {
701 }
702 return;
703 }
704 }
705
706 // Token: 0x06000069 RID: 105 RVA: 0x00003C5C File Offset: 0x00001E5C
708 {
709 bool flag;
710 return flag;
711 }
712
713 // Token: 0x0600006A RID: 106 RVA: 0x00003C6C File Offset: 0x00001E6C
715 {
716 }
717
718 // Token: 0x0600006B RID: 107 RVA: 0x00003C7C File Offset: 0x00001E7C
720 {
723 if (safeBags2 != null)
724 {
725 }
726 object[] items = safeBags2._items;
727 int size = safeBags2._size;
728 ASN1 asn;
729 byte[] value = asn.Value;
730 }
731
732 // Token: 0x0600006C RID: 108 RVA: 0x00003D18 File Offset: 0x00001F18
734 {
737 if (safeBags2 != null)
738 {
739 }
740 object[] items = safeBags2._items;
741 int size = safeBags2._size;
742 ASN1 asn;
743 byte[] value = asn.Value;
744 }
745
746 // Token: 0x0600006D RID: 109 RVA: 0x00003D98 File Offset: 0x00001F98
748 {
749 }
750
751 // Token: 0x0600006E RID: 110 RVA: 0x00003DA8 File Offset: 0x00001FA8
752 public void AddKeyBag(AsymmetricAlgorithm aa, IDictionary attributes)
753 {
756 if (safeBags2 != null)
757 {
758 }
759 object[] items = safeBags2._items;
760 int size = safeBags2._size;
761 ASN1 asn;
762 byte[] value = asn.Value;
763 }
764
765 // Token: 0x0600006F RID: 111 RVA: 0x00003E28 File Offset: 0x00002028
767 {
770 if (safeBags2 != null)
771 {
772 }
773 object[] items = safeBags2._items;
774 int size = safeBags2._size;
775 ASN1 asn;
776 byte[] value = asn.Value;
777 }
778
779 // Token: 0x06000070 RID: 112 RVA: 0x00003E98 File Offset: 0x00002098
780 public void AddSecretBag(byte[] secret)
781 {
782 }
783
784 // Token: 0x06000071 RID: 113 RVA: 0x00003EA8 File Offset: 0x000020A8
785 public void AddSecretBag(byte[] secret, IDictionary attributes)
786 {
789 if (safeBags2 != null)
790 {
791 }
792 object[] items = safeBags2._items;
793 int size = safeBags2._size;
794 ASN1 asn;
795 byte[] value = asn.Value;
796 }
797
798 // Token: 0x06000072 RID: 114 RVA: 0x00003F08 File Offset: 0x00002108
799 public void RemoveSecretBag(byte[] secret)
800 {
803 if (safeBags2 != null)
804 {
805 }
806 object[] items = safeBags2._items;
807 int size = safeBags2._size;
808 ASN1 asn;
809 byte[] value = asn.Value;
810 }
811
812 // Token: 0x06000073 RID: 115 RVA: 0x00003F60 File Offset: 0x00002160
814 {
816 if (safeBags != null)
817 {
818 }
819 object[] items = safeBags._items;
820 long num = 0L;
821 ASN1 asn;
822 if (asn.elist != null)
823 {
824 }
825 ASN1 asn2 = asn[(int)num];
826 long num2 = 0L;
827 string text = ASN1Convert.ToOid(asn2[(int)num2]);
828 if (attrs != null)
829 {
830 int num3 = 1;
831 ASN1 asn3 = asn2[num3];
832 if (asn3.elist != null)
833 {
834 }
835 long num4 = 0L;
836 if (asn3.elist != null)
837 {
838 }
839 ASN1 asn4 = asn3[(int)num4];
840 if (attrs == null || attrs == null)
841 {
842 }
843 byte[] value = asn4.Value;
844 if (asn3.elist != null)
845 {
846 }
847 }
848 if (asn.elist != null)
849 {
850 }
851 ASN1 asn5;
852 byte[] value2 = asn5.Value;
853 byte[] array;
855 long num5 = 0L;
856 if (rsa != null)
857 {
858 }
859 if (num5 == 0L)
860 {
861 int keySizeValue = rsa.KeySizeValue;
862 byte[] array2;
864 long num6 = 0L;
865 long num7 = 0L;
866 Array.Clear(array2, (int)num7, (int)num6);
867 throw new InvalidCastException();
868 }
869 throw new OutOfMemoryException();
870 }
871
872 // Token: 0x06000074 RID: 116 RVA: 0x00004084 File Offset: 0x00002284
873 public byte[] GetSecret(IDictionary attrs)
874 {
876 bool flag;
877 while (!flag)
878 {
879 }
880 long num = 0L;
881 ASN1 asn;
882 if (asn.elist != null)
883 {
884 }
885 ASN1 asn2 = asn[(int)num];
886 long num2 = 0L;
887 string text = ASN1Convert.ToOid(asn2[(int)num2]);
888 if (text != null)
889 {
890 int num3 = 1;
891 ASN1 asn3 = asn2[num3];
892 if (asn3.elist != null)
893 {
894 }
895 long num4 = 0L;
896 if (asn3.elist != null)
897 {
898 }
899 ASN1 asn4 = asn3[(int)num4];
900 if (text == null || text == null)
901 {
902 }
903 return asn4.Value;
904 }
905 if (asn.elist != null)
906 {
907 }
908 ASN1 asn5;
909 return asn5.Value;
910 }
911
912 // Token: 0x06000075 RID: 117 RVA: 0x00004180 File Offset: 0x00002380
914 {
916 bool flag;
917 while (!flag)
918 {
919 }
920 long num = 0L;
921 ASN1 asn;
922 if (asn.elist != null)
923 {
924 }
925 ASN1 asn2 = asn[(int)num];
926 long num2 = 0L;
927 string text = ASN1Convert.ToOid(asn2[(int)num2]);
928 if (text != null)
929 {
930 int num3 = 1;
931 ASN1 asn3 = asn2[num3];
932 if (asn3.elist != null)
933 {
934 }
935 long num4 = 0L;
936 if (asn3.elist != null)
937 {
938 }
939 ASN1 asn4 = asn3[(int)num4];
940 if (text == null || text == null)
941 {
942 }
943 byte[] value = asn4.Value;
944 if (asn3.elist != null)
945 {
946 }
947 }
948 if (asn.elist != null)
949 {
950 }
951 ASN1 asn5;
952 byte[] value2 = asn5.Value;
953 ASN1 asn6;
954 byte[] value3 = asn6.Value;
955 if (!false)
956 {
957 throw new InvalidCastException();
958 }
959 throw new OutOfMemoryException();
960 }
961
962 // Token: 0x06000076 RID: 118 RVA: 0x00004270 File Offset: 0x00002470
964 {
965 ASN1 asn;
966 byte[] value = asn.Value;
967 byte[] array;
969 byte[] array2;
971 long num = 0L;
972 long num2 = 0L;
973 byte[] array3;
974 Array.Clear(array3, (int)num2, (int)num);
975 long num3 = 0L;
976 long num4 = 0L;
977 long num5 = 0L;
978 Array.Clear(array2, (int)num5, (int)num3);
979 long num6 = 0L;
980 Array.Clear(array3, (int)num6, (int)num3);
981 while (num4 == 0L)
982 {
983 }
984 bool flag;
985 while (!flag)
986 {
987 }
988 long num7 = 0L;
989 ASN1 asn2;
990 if (asn2.elist != null)
991 {
992 }
993 ASN1 asn3 = asn2[(int)num7];
994 long num8 = 0L;
995 string text = ASN1Convert.ToOid(asn3[(int)num8]);
996 int num9 = 1;
997 ASN1 asn4 = asn3[num9];
998 long num10 = 0L;
999 if (asn4.elist != null)
1000 {
1001 }
1002 byte[] value2 = asn4[(int)num10].Value;
1003 if (!false)
1004 {
1005 throw new InvalidCastException();
1006 }
1007 throw new OutOfMemoryException();
1008 }
1009
1010 // Token: 0x06000077 RID: 119 RVA: 0x00004344 File Offset: 0x00002544
1012 {
1014 if (safeBags != null)
1015 {
1016 }
1017 object[] items = safeBags._items;
1018 int size = safeBags._size;
1019 ASN1 asn;
1020 byte[] value = asn.Value;
1021 ASN1 asn2;
1022 byte[] value2 = asn2.Value;
1023 byte[] encodedcert = cert.m_encodedcert;
1024 long num = 0L;
1025 long num2 = 0L;
1026 ASN1 asn3;
1027 if (asn3.elist != null)
1028 {
1029 }
1030 ASN1 asn4 = asn3[(int)num2];
1031 long num3 = 0L;
1032 string text = ASN1Convert.ToOid(asn4[(int)num3]);
1033 int num4 = 1;
1034 ASN1 asn5 = asn4[num4];
1035 long num5 = 0L;
1036 if (asn5.elist != null)
1037 {
1038 }
1039 byte[] value3 = asn5[(int)num5].Value;
1040 if (num != 0L)
1041 {
1042 }
1043 long num6 = 0L;
1044 if (safeBags == null || num != 0L)
1045 {
1046 }
1047 if (num6 == 0L)
1048 {
1049 throw new InvalidCastException();
1050 }
1051 throw new OutOfMemoryException();
1052 }
1053
1054 // Token: 0x06000078 RID: 120 RVA: 0x00004414 File Offset: 0x00002614
1055 public void SaveToFile(string filename)
1056 {
1057 if (filename != null)
1058 {
1059 FileStream fileStream = File.Create(filename);
1060 byte[] bytes = this.GetBytes();
1061 return;
1062 }
1063 throw new OutOfMemoryException();
1064 }
1065
1066 // Token: 0x06000079 RID: 121 RVA: 0x00004454 File Offset: 0x00002654
1067 public object Clone()
1068 {
1069 /*
1070An exception occurred when decompiling this method (06000079)
1071
1072ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Object Mono.Security.X509.PKCS12::Clone()
1073
1074 ---> System.Exception: Basic block has to end with unconditional control flow.
1075{
1076 IL_0021:
1077 stloc:int32(var_5_27, ldfld:int32(PKCS12::_iterations, ldloc:PKCS12(this)))
1078}
1079
1080 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
1081 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
1082 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
1083 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
1084 --- End of inner exception stack trace ---
1085 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
1086 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
1087*/;
1088 }
1089
1090 // Token: 0x1700001E RID: 30
1091 // (get) Token: 0x0600007A RID: 122 RVA: 0x0000448C File Offset: 0x0000268C
1092 // (set) Token: 0x0600007B RID: 123 RVA: 0x000044A0 File Offset: 0x000026A0
1093 public static int MaximumPasswordLength
1094 {
1095 get
1096 {
1097 if (!true)
1098 {
1099 }
1100 return 1;
1101 }
1102 set
1103 {
1104 if (!true)
1105 {
1106 }
1107 }
1108 }
1109
1110 // Token: 0x0600007C RID: 124 RVA: 0x000044B8 File Offset: 0x000026B8
1111 private static byte[] LoadFile(string filename)
1112 {
1113 if (!false)
1114 {
1115 }
1116 throw new OutOfMemoryException();
1117 }
1118
1119 // Token: 0x0600007D RID: 125 RVA: 0x000044F0 File Offset: 0x000026F0
1120 public static PKCS12 LoadFromFile(string filename)
1121 {
1122 /*
1123An exception occurred when decompiling this method (0600007D)
1124
1125ICSharpCode.Decompiler.DecompilerException: Error decompiling Mono.Security.X509.PKCS12 Mono.Security.X509.PKCS12::LoadFromFile(System.String)
1126
1127 ---> System.Exception: Basic block has to end with unconditional control flow.
1128{
1129 IL_0000:
1130 brtrue(IL_0000, ldc.i4:bool(1))
1131}
1132
1133 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
1134 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
1135 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
1136 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
1137 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
1138 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
1139 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
1140 --- End of inner exception stack trace ---
1141 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
1142 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
1143*/;
1144 }
1145
1146 // Token: 0x0600007E RID: 126 RVA: 0x00004500 File Offset: 0x00002700
1147 public static PKCS12 LoadFromFile(string filename, string password)
1148 {
1149 /*
1150An exception occurred when decompiling this method (0600007E)
1151
1152ICSharpCode.Decompiler.DecompilerException: Error decompiling Mono.Security.X509.PKCS12 Mono.Security.X509.PKCS12::LoadFromFile(System.String,System.String)
1153
1154 ---> System.Exception: Basic block has to end with unconditional control flow.
1155{
1156 IL_0000:
1157 brtrue(IL_0000, ldc.i4:bool(1))
1158}
1159
1160 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
1161 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
1162 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
1163 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
1164 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
1165 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
1166 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
1167 --- End of inner exception stack trace ---
1168 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
1169 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
1170*/;
1171 }
1172
1173 // Token: 0x0600007F RID: 127 RVA: 0x00004510 File Offset: 0x00002710
1174 // Note: this type is marked as 'beforefieldinit'.
1175 static PKCS12()
1176 {
1177 }
1178
1179 // Token: 0x04000023 RID: 35
1180 public const string pbeWithSHAAnd128BitRC4 = "1.2.840.113549.1.12.1.1";
1181
1182 // Token: 0x04000024 RID: 36
1183 public const string pbeWithSHAAnd40BitRC4 = "1.2.840.113549.1.12.1.2";
1184
1185 // Token: 0x04000025 RID: 37
1186 public const string pbeWithSHAAnd3KeyTripleDESCBC = "1.2.840.113549.1.12.1.3";
1187
1188 // Token: 0x04000026 RID: 38
1189 public const string pbeWithSHAAnd2KeyTripleDESCBC = "1.2.840.113549.1.12.1.4";
1190
1191 // Token: 0x04000027 RID: 39
1192 public const string pbeWithSHAAnd128BitRC2CBC = "1.2.840.113549.1.12.1.5";
1193
1194 // Token: 0x04000028 RID: 40
1195 public const string pbeWithSHAAnd40BitRC2CBC = "1.2.840.113549.1.12.1.6";
1196
1197 // Token: 0x04000029 RID: 41
1198 public const string keyBag = "1.2.840.113549.1.12.10.1.1";
1199
1200 // Token: 0x0400002A RID: 42
1201 public const string pkcs8ShroudedKeyBag = "1.2.840.113549.1.12.10.1.2";
1202
1203 // Token: 0x0400002B RID: 43
1204 public const string certBag = "1.2.840.113549.1.12.10.1.3";
1205
1206 // Token: 0x0400002C RID: 44
1207 public const string crlBag = "1.2.840.113549.1.12.10.1.4";
1208
1209 // Token: 0x0400002D RID: 45
1210 public const string secretBag = "1.2.840.113549.1.12.10.1.5";
1211
1212 // Token: 0x0400002E RID: 46
1213 public const string safeContentsBag = "1.2.840.113549.1.12.10.1.6";
1214
1215 // Token: 0x0400002F RID: 47
1216 public const string x509Certificate = "1.2.840.113549.1.9.22.1";
1217
1218 // Token: 0x04000030 RID: 48
1219 public const string sdsiCertificate = "1.2.840.113549.1.9.22.2";
1220
1221 // Token: 0x04000031 RID: 49
1222 public const string x509Crl = "1.2.840.113549.1.9.23.1";
1223
1224 // Token: 0x04000032 RID: 50
1225 private const int recommendedIterationCount = 2000;
1226
1227 // Token: 0x04000033 RID: 51
1228 private byte[] _password;
1229
1230 // Token: 0x04000034 RID: 52
1232
1233 // Token: 0x04000035 RID: 53
1235
1236 // Token: 0x04000036 RID: 54
1238
1239 // Token: 0x04000037 RID: 55
1240 private bool _keyBagsChanged;
1241
1242 // Token: 0x04000038 RID: 56
1244
1245 // Token: 0x04000039 RID: 57
1246 private bool _certsChanged;
1247
1248 // Token: 0x0400003A RID: 58
1249 private int _iterations;
1250
1251 // Token: 0x0400003B RID: 59
1253
1254 // Token: 0x0400003C RID: 60
1256
1257 // Token: 0x0400003D RID: 61
1258 public const int CryptoApiPasswordLimit = 32;
1259
1260 // Token: 0x0400003E RID: 62
1261 private static int password_max_length;
1262
1263 // Token: 0x0200000F RID: 15
1264 public class DeriveBytes
1265 {
1266 // Token: 0x06000080 RID: 128 RVA: 0x00004520 File Offset: 0x00002720
1268 {
1269 }
1270
1271 // Token: 0x1700001F RID: 31
1272 // (get) Token: 0x06000081 RID: 129 RVA: 0x00004534 File Offset: 0x00002734
1273 // (set) Token: 0x06000082 RID: 130 RVA: 0x00004548 File Offset: 0x00002748
1274 public string HashName
1275 {
1276 get
1277 {
1278 return this._hashName;
1279 }
1280 set
1281 {
1283 }
1284 }
1285
1286 // Token: 0x17000020 RID: 32
1287 // (get) Token: 0x06000083 RID: 131 RVA: 0x0000455C File Offset: 0x0000275C
1288 // (set) Token: 0x06000084 RID: 132 RVA: 0x00004570 File Offset: 0x00002770
1290 {
1291 get
1292 {
1293 return this._iterations;
1294 }
1295 set
1296 {
1298 }
1299 }
1300
1301 // Token: 0x17000021 RID: 33
1302 // (get) Token: 0x06000085 RID: 133 RVA: 0x00004584 File Offset: 0x00002784
1303 // (set) Token: 0x06000086 RID: 134 RVA: 0x000045A4 File Offset: 0x000027A4
1304 public byte[] Password
1305 {
1306 get
1307 {
1308 byte[] password = this._password;
1309 object obj;
1310 if (obj == null || obj != null)
1311 {
1312 }
1313 throw new InvalidCastException();
1314 }
1315 set
1316 {
1317 if (value != null)
1318 {
1319 object obj;
1320 if (obj != null)
1321 {
1322 if (obj == null)
1323 {
1324 throw new InvalidCastException();
1325 }
1327 if (obj == null)
1328 {
1329 throw new InvalidCastException();
1330 }
1331 }
1332 return;
1333 }
1334 }
1335 }
1336
1337 // Token: 0x17000022 RID: 34
1338 // (get) Token: 0x06000087 RID: 135 RVA: 0x000045D4 File Offset: 0x000027D4
1339 // (set) Token: 0x06000088 RID: 136 RVA: 0x000045F4 File Offset: 0x000027F4
1340 public byte[] Salt
1341 {
1342 get
1343 {
1344 byte[] salt = this._salt;
1345 object obj;
1346 if (obj == null || obj != null)
1347 {
1348 }
1349 throw new InvalidCastException();
1350 }
1351 set
1352 {
1353 object obj;
1354 if (value != null && obj != null)
1355 {
1356 if (obj == null)
1357 {
1358 throw new InvalidCastException();
1359 }
1360 this._salt = obj;
1361 if (obj == null)
1362 {
1363 throw new InvalidCastException();
1364 }
1365 }
1366 }
1367 }
1368
1369 // Token: 0x06000089 RID: 137 RVA: 0x00004620 File Offset: 0x00002820
1370 private void Adjust(byte[] a, int aOff, byte[] b)
1371 {
1372 }
1373
1374 // Token: 0x0600008A RID: 138 RVA: 0x00004630 File Offset: 0x00002830
1375 private byte[] Derive(byte[] diversifier, int n)
1376 {
1377 int num = 1;
1378 string hashName = this._hashName;
1379 if (num == 0)
1380 {
1381 }
1382 HashAlgorithm hashAlgorithm = PKCS1.CreateFromName(hashName);
1383 byte[] salt = this._salt;
1384 if (salt != null && salt != null)
1385 {
1386 if (salt != null)
1387 {
1388 byte[] salt2 = this._salt;
1389 }
1390 }
1391 byte[] password = this._password;
1392 if (password != null && password != null)
1393 {
1394 if (password != null)
1395 {
1396 byte[] password2 = this._password;
1397 }
1398 }
1399 long num2 = 0L;
1400 long num3 = 0L;
1401 long num4 = 0L;
1402 int num5 = hashAlgorithm.TransformBlock(diversifier, (int)num3, (int)num2, diversifier, (int)num4);
1403 int iterations = this._iterations;
1404 byte[] hashValue = hashAlgorithm.HashValue;
1405 if (this._iterations != 0)
1406 {
1407 }
1408 byte[] array;
1409 return array;
1410 }
1411
1412 // Token: 0x0600008B RID: 139 RVA: 0x000046D4 File Offset: 0x000028D4
1413 public byte[] DeriveKey(int size)
1414 {
1415 if (!true)
1416 {
1417 }
1418 byte[] array;
1419 return array;
1420 }
1421
1422 // Token: 0x0600008C RID: 140 RVA: 0x000046E8 File Offset: 0x000028E8
1423 public byte[] DeriveIV(int size)
1424 {
1425 if (!true)
1426 {
1427 }
1428 byte[] array;
1429 return array;
1430 }
1431
1432 // Token: 0x0600008D RID: 141 RVA: 0x000046FC File Offset: 0x000028FC
1433 public byte[] DeriveMAC(int size)
1434 {
1435 if (!true)
1436 {
1437 }
1438 byte[] array;
1439 return array;
1440 }
1441
1442 // Token: 0x0600008E RID: 142 RVA: 0x00004710 File Offset: 0x00002910
1443 // Note: this type is marked as 'beforefieldinit'.
1445 {
1446 }
1447
1448 // Token: 0x0400003F RID: 63
1449 private static byte[] keyDiversifier;
1450
1451 // Token: 0x04000040 RID: 64
1452 private static byte[] ivDiversifier;
1453
1454 // Token: 0x04000041 RID: 65
1455 private static byte[] macDiversifier;
1456
1457 // Token: 0x04000042 RID: 66
1458 private string _hashName;
1459
1460 // Token: 0x04000043 RID: 67
1461 private int _iterations;
1462
1463 // Token: 0x04000044 RID: 68
1464 private byte[] _password;
1465
1466 // Token: 0x04000045 RID: 69
1467 private byte[] _salt;
1468
1469 // Token: 0x02000010 RID: 16
1470 public enum Purpose
1471 {
1472 // Token: 0x04000047 RID: 71
1473 Key,
1474 // Token: 0x04000048 RID: 72
1475 IV,
1476 // Token: 0x04000049 RID: 73
1477 MAC
1478 }
1479 }
1480 }
1481}
class f__AnonymousType0<< Count > j__TPar
static string ToOid(ASN1 asn1)
static int ToInt32(ASN1 asn1)
static ASN1 FromOid(string oid)
ASN1 Add(ASN1 asn1)
Definition ASN1.cs:150
byte[] Value
Definition ASN1.cs:89
static HashAlgorithm CreateFromName(string name)
Definition PKCS1.cs:124
static RSA DecodeRSA(byte[] keypair)
Definition PKCS8.cs:141
byte[] Derive(byte[] diversifier, int n)
Definition PKCS12.cs:1375
void Adjust(byte[] a, int aOff, byte[] b)
Definition PKCS12.cs:1370
DSAParameters GetExistingParameters([Out] bool found)
Definition PKCS12.cs:281
ASN1 Pkcs8ShroudedKeyBagSafeBag(AsymmetricAlgorithm aa, IDictionary attributes)
Definition PKCS12.cs:332
void RemoveCertificate(X509Certificate cert)
Definition PKCS12.cs:670
void AddPkcs8ShroudedKeyBag(AsymmetricAlgorithm aa, IDictionary attributes)
Definition PKCS12.cs:719
byte[] MAC(byte[] password, byte[] salt, int iterations, byte[] data)
Definition PKCS12.cs:417
void RemoveCertificate(X509Certificate cert, IDictionary attrs)
Definition PKCS12.cs:675
ASN1 SecretBagSafeBag(byte[] secret, IDictionary attributes)
Definition PKCS12.cs:377
byte[] GetSecret(IDictionary attrs)
Definition PKCS12.cs:873
const string x509Certificate
Definition PKCS12.cs:1216
void RemoveSecretBag(byte[] secret)
Definition PKCS12.cs:799
byte[] Encrypt(string algorithmOid, byte[] salt, int iterationCount, byte[] data)
Definition PKCS12.cs:267
PKCS12(byte[] data)
Definition PKCS12.cs:20
void AddSecretBag(byte[] secret, IDictionary attributes)
Definition PKCS12.cs:785
const string secretBag
Definition PKCS12.cs:1210
void SaveToFile(string filename)
Definition PKCS12.cs:1055
void ReadSafeBag(ASN1 safeBag)
Definition PKCS12.cs:319
byte[] Decrypt(string algorithmOid, byte[] salt, int iterationCount, byte[] encryptedData)
Definition PKCS12.cs:240
void AddCertificate(X509Certificate cert, IDictionary attributes)
Definition PKCS12.cs:657
const int CryptoApiPasswordLimit
Definition PKCS12.cs:1258
ASN1 CertificateSafeBag(X509Certificate x509, IDictionary attributes)
Definition PKCS12.cs:397
IDictionary GetAttributes(AsymmetricAlgorithm aa)
Definition PKCS12.cs:963
AsymmetricAlgorithm GetAsymmetricAlgorithm(IDictionary attrs)
Definition PKCS12.cs:813
IDictionary GetAttributes(X509Certificate cert)
Definition PKCS12.cs:1011
void AddKeyBag(AsymmetricAlgorithm aa)
Definition PKCS12.cs:747
PKCS12(byte[] data, string password)
Definition PKCS12.cs:26
RandomNumberGenerator _rng
Definition PKCS12.cs:1255
void AddCertificate(X509Certificate cert)
Definition PKCS12.cs:652
const string pbeWithSHAAnd3KeyTripleDESCBC
Definition PKCS12.cs:1186
SymmetricAlgorithm GetSymmetricAlgorithm(string algorithmOid, byte[] salt, int iterationCount)
Definition PKCS12.cs:225
const int recommendedIterationCount
Definition PKCS12.cs:1225
void AddPrivateKey(PKCS8.PrivateKeyInfo pki)
Definition PKCS12.cs:309
override void Finalize()
Definition PKCS12.cs:83
bool CompareAsymmetricAlgorithm(AsymmetricAlgorithm a1, AsymmetricAlgorithm a2)
Definition PKCS12.cs:707
bool Compare(byte[] expected, byte[] actual)
Definition PKCS12.cs:220
const string pbeWithSHAAnd128BitRC2CBC
Definition PKCS12.cs:1192
RandomNumberGenerator RNG
Definition PKCS12.cs:206
void AddKeyBag(AsymmetricAlgorithm aa, IDictionary attributes)
Definition PKCS12.cs:752
const string pbeWithSHAAnd128BitRC4
Definition PKCS12.cs:1180
PKCS7.ContentInfo EncryptedContentInfo(ASN1 safeBags, string algorithmOid)
Definition PKCS12.cs:625
static int MaximumPasswordLength
Definition PKCS12.cs:1094
const string safeContentsBag
Definition PKCS12.cs:1213
void RemoveKeyBag(AsymmetricAlgorithm aa)
Definition PKCS12.cs:766
X509CertificateCollection Certificates
Definition PKCS12.cs:168
PKCS12(byte[] data, byte[] password)
Definition PKCS12.cs:33
void AddPkcs8ShroudedKeyBag(AsymmetricAlgorithm aa)
Definition PKCS12.cs:714
const string pbeWithSHAAnd40BitRC4
Definition PKCS12.cs:1183
static PKCS12 LoadFromFile(string filename)
Definition PKCS12.cs:1120
X509CertificateCollection _certs
Definition PKCS12.cs:1237
const string pbeWithSHAAnd40BitRC2CBC
Definition PKCS12.cs:1195
const string pbeWithSHAAnd2KeyTripleDESCBC
Definition PKCS12.cs:1189
void Decode(byte[] data)
Definition PKCS12.cs:40
byte[] Decrypt(PKCS7.EncryptedData ed)
Definition PKCS12.cs:255
void RemovePkcs8ShroudedKeyBag(AsymmetricAlgorithm aa)
Definition PKCS12.cs:733
const string pkcs8ShroudedKeyBag
Definition PKCS12.cs:1201
ASN1 KeyBagSafeBag(AsymmetricAlgorithm aa, IDictionary attributes)
Definition PKCS12.cs:357
const string sdsiCertificate
Definition PKCS12.cs:1219
void AddSecretBag(byte[] secret)
Definition PKCS12.cs:780
static PKCS12 LoadFromFile(string filename, string password)
Definition PKCS12.cs:1147
static int password_max_length
Definition PKCS12.cs:1261
static byte[] LoadFile(string filename)
Definition PKCS12.cs:1111
X509Certificate GetCertificate(IDictionary attrs)
Definition PKCS12.cs:913
new X509CertificateCollection.X509CertificateEnumerator GetEnumerator()
void IList. Clear()
Definition Array.cs:99
static ArrayList ReadOnly(ArrayList list)
Definition ArrayList.cs:324
static FileStream Create(string path)
Definition File.cs:64
static new HMAC Create()
Definition HMAC.cs:136
int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)