Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AsnDecoder.cs
Go to the documentation of this file.
8using System.Text;
9
10namespace System.Formats.Asn1;
11
12public static class AsnDecoder
13{
23
31
33
56
77
99
104
106 {
107 int? length;
109 {
110 case LengthDecodeStatus.Success:
111 return length;
112 case LengthDecodeStatus.LengthTooBig:
114 case LengthDecodeStatus.DerIndefinite:
115 case LengthDecodeStatus.LaxEncodingProhibited:
117 default:
118 throw new AsnContentException();
119 }
120 }
121
123 {
124 length = null;
125 bytesRead = 0;
126 if (source.IsEmpty)
127 {
128 return LengthDecodeStatus.NeedMoreData;
129 }
130 byte b = source[bytesRead];
131 bytesRead++;
132 if (b == 128)
133 {
134 if (ruleSet == AsnEncodingRules.DER)
135 {
136 bytesRead = 0;
137 return LengthDecodeStatus.DerIndefinite;
138 }
139 return LengthDecodeStatus.Success;
140 }
141 if (b < 128)
142 {
143 length = b;
144 return LengthDecodeStatus.Success;
145 }
146 if (b == byte.MaxValue)
147 {
148 bytesRead = 0;
149 return LengthDecodeStatus.ReservedValue;
150 }
151 byte b2 = (byte)(b & 0xFFFFFF7Fu);
152 if (b2 + 1 > source.Length)
153 {
154 bytesRead = 0;
155 return LengthDecodeStatus.NeedMoreData;
156 }
157 bool flag = ruleSet == AsnEncodingRules.DER || ruleSet == AsnEncodingRules.CER;
158 if (flag && b2 > 4)
159 {
160 bytesRead = 0;
161 return LengthDecodeStatus.LengthTooBig;
162 }
163 uint num = 0u;
164 for (int i = 0; i < b2; i++)
165 {
166 byte b3 = source[bytesRead];
167 bytesRead++;
168 if (num == 0)
169 {
170 if (flag && b3 == 0)
171 {
172 bytesRead = 0;
173 return LengthDecodeStatus.LaxEncodingProhibited;
174 }
175 if (!flag && b3 != 0 && b2 - i > 4)
176 {
177 bytesRead = 0;
178 return LengthDecodeStatus.LengthTooBig;
179 }
180 }
181 num <<= 8;
182 num |= b3;
183 }
184 if (num > int.MaxValue)
185 {
186 bytesRead = 0;
187 return LengthDecodeStatus.LengthTooBig;
188 }
189 if (flag && num < 128)
190 {
191 bytesRead = 0;
192 return LengthDecodeStatus.LaxEncodingProhibited;
193 }
194 length = (int)num;
195 return LengthDecodeStatus.Success;
196 }
197
199 {
200 int bytesConsumed;
202 int bytesConsumed2;
205 if (result.IsConstructed)
206 {
207 if (ruleSet == AsnEncodingRules.CER && num.HasValue)
208 {
209 throw GetValidityException(LengthValidity.CerRequiresIndefinite);
210 }
211 }
212 else if (!num.HasValue)
213 {
214 throw GetValidityException(LengthValidity.PrimitiveEncodingRequiresDefinite);
215 }
216 bytesRead = num2;
217 contentsLength = num;
218 return result;
219 }
220
221 private static void ValidateEndOfContents(Asn1Tag tag, int? length, int headerLength)
222 {
223 if (tag.IsConstructed || length != 0 || headerLength != 2)
224 {
225 throw new AsnContentException();
226 }
227 }
228
230 {
231 if (localTag.IsConstructed)
232 {
233 if (ruleSet == AsnEncodingRules.CER && encodedLength.HasValue)
234 {
236 return LengthValidity.CerRequiresIndefinite;
237 }
238 }
239 else if (!encodedLength.HasValue)
240 {
242 return LengthValidity.PrimitiveEncodingRequiresDefinite;
243 }
244 if (encodedLength.HasValue)
245 {
246 int value = encodedLength.Value;
247 int num = value;
248 if (num > source.Length)
249 {
251 return LengthValidity.LengthExceedsInput;
252 }
255 return LengthValidity.Valid;
256 }
259 return LengthValidity.Valid;
260 }
261
263 {
264 return validity switch
265 {
266 LengthValidity.CerRequiresIndefinite => new AsnContentException(System.SR.ContentException_CerRequiresIndefiniteLength),
267 LengthValidity.LengthExceedsInput => new AsnContentException(System.SR.ContentException_LengthExceedsPayload),
268 _ => new AsnContentException(),
269 };
270 }
271
273 {
275 int num = 0;
276 int num2 = 1;
277 while (!source2.IsEmpty)
278 {
279 int? contentsLength;
280 int bytesRead;
283 {
285 num2--;
286 if (num2 == 0)
287 {
288 return num;
289 }
290 }
291 if (!contentsLength.HasValue)
292 {
293 num2++;
294 source2 = source2.Slice(bytesRead);
295 num += bytesRead;
296 }
297 else
298 {
300 source2 = source2.Slice(readOnlySpan.Length);
301 num += readOnlySpan.Length;
302 }
303 }
304 throw new AsnContentException();
305 }
306
308 {
309 int result = ParseNonNegativeInt(Slice(data, 0, bytesToRead));
310 data = data.Slice(bytesToRead);
311 return result;
312 }
313
315 {
316 if (Utf8Parser.TryParse(data, out uint value, out int bytesConsumed, '\0') && value <= int.MaxValue && bytesConsumed == data.Length)
317 {
318 return (int)value;
319 }
320 throw new AsnContentException();
321 }
322
327
329 {
330 if (length < 0 || source.Length - offset < length)
331 {
333 }
334 return source.Slice(offset, length);
335 }
336
338 {
339 if (!length.HasValue)
340 {
341 return source.Slice(offset);
342 }
343 int value = length.Value;
344 if (value < 0 || source.Length - offset < value)
345 {
347 }
348 return source.Slice(offset, value);
349 }
350
352 {
353 if (smaller.IsEmpty)
354 {
355 return default(ReadOnlyMemory<byte>);
356 }
357 if (bigger.Span.Overlaps(smaller, out var elementOffset))
358 {
359 return bigger.Slice(elementOffset, smaller.Length);
360 }
361 throw new AsnContentException();
362 }
363
365 {
366 if (ruleSet != 0 && ruleSet != AsnEncodingRules.CER && ruleSet != AsnEncodingRules.DER)
367 {
368 throw new ArgumentOutOfRangeException("ruleSet");
369 }
370 }
371
373 {
374 if (expectedTag.TagClass == TagClass.Universal && expectedTag.TagValue != (int)tagNumber)
375 {
377 }
378 if (expectedTag.TagClass != tag.TagClass || expectedTag.TagValue != tag.TagValue)
379 {
381 }
382 }
383
398
430
456
458 {
459 if (ruleSet == AsnEncodingRules.CER && source.Length > 1000)
460 {
462 }
463 if (source.Length == 0)
464 {
465 throw new AsnContentException();
466 }
468 if (unusedBitCount > 7)
469 {
470 throw new AsnContentException();
471 }
472 if (source.Length == 1)
473 {
474 if (unusedBitCount > 0)
475 {
476 throw new AsnContentException();
477 }
480 return;
481 }
482 int num = -1 << unusedBitCount;
483 byte b = source[source.Length - 1];
484 byte b2 = (byte)(b & num);
485 if (b2 != b && (ruleSet == AsnEncodingRules.DER || ruleSet == AsnEncodingRules.CER))
486 {
488 }
490 value = source.Slice(1);
491 }
492
494 {
495 if (value.Length != 0)
496 {
497 value.CopyTo(destination);
498 destination[value.Length - 1] = normalizedLastByte;
499 }
500 }
501
509
517
519 {
521 bytesRead = 0;
522 int num = 1000;
524 Stack<(int, int, bool, int)> stack = null;
525 int num2 = 0;
528 while (true)
529 {
530 if (!readOnlySpan.IsEmpty)
531 {
534 {
535 if (lastUnusedBitCount != 0)
536 {
537 throw new AsnContentException();
538 }
539 if (ruleSet == AsnEncodingRules.CER && num != 1000)
540 {
542 }
545 int num3 = bytesRead2 + source2.Length;
547 bytesRead += num3;
548 num2 += value.Length;
549 num = source2.Length;
550 if (copyAction != null)
551 {
553 destination2 = destination2.Slice(value.Length);
554 }
555 continue;
556 }
558 {
560 {
561 if (ruleSet == AsnEncodingRules.CER)
562 {
564 }
565 if (stack == null)
566 {
567 stack = new Stack<(int, int, bool, int)>();
568 }
569 if (!source.Overlaps(readOnlySpan, out var elementOffset))
570 {
571 throw new AsnContentException();
572 }
573 stack.Push((elementOffset, readOnlySpan.Length, isIndefinite, bytesRead));
576 isIndefinite = !contentsLength.HasValue;
577 continue;
578 }
579 throw new AsnContentException();
580 }
583 if (stack != null && stack.Count > 0)
584 {
585 (int, int, bool, int) tuple = stack.Pop();
586 int item = tuple.Item1;
587 int item2 = tuple.Item2;
588 bool item3 = tuple.Item3;
589 int item4 = tuple.Item4;
590 readOnlySpan = source.Slice(item, item2).Slice(bytesRead);
591 bytesRead += item4;
593 continue;
594 }
595 }
597 {
598 throw new AsnContentException();
599 }
600 if (stack == null || stack.Count <= 0)
601 {
602 break;
603 }
604 (int, int, bool, int) tuple2 = stack.Pop();
605 int item5 = tuple2.Item1;
606 int item6 = tuple2.Item2;
607 bool item7 = tuple2.Item3;
608 int item8 = tuple2.Item4;
609 readOnlySpan = source.Slice(item5, item6).Slice(bytesRead);
611 bytesRead += item8;
612 }
613 return num2;
614 }
615
633
655
657 {
658 int bytesConsumed2;
660 if (primitiveContentSpan.Length != 1)
661 {
662 throw new AsnContentException();
663 }
664 switch (primitiveContentSpan[0])
665 {
666 case 0:
668 return false;
669 default:
671 {
673 }
674 break;
675 case byte.MaxValue:
676 break;
677 }
679 return true;
680 }
681
686
692
694 {
695 if (enumType == null)
696 {
697 throw new ArgumentNullException("enumType");
698 }
700 Type enumUnderlyingType = enumType.GetEnumUnderlyingType();
701 if (enumType.IsDefined(typeof(FlagsAttribute), inherit: false))
702 {
704 }
707 {
709 {
711 }
713 return (Enum)Enum.ToObject(enumType, value);
714 }
715 if (enumUnderlyingType == typeof(uint) || enumUnderlyingType == typeof(ulong) || enumUnderlyingType == typeof(ushort) || enumUnderlyingType == typeof(byte))
716 {
718 {
720 }
722 return (Enum)Enum.ToObject(enumType, value2);
723 }
725 }
726
741
743 {
744 bool flag = ruleSet == AsnEncodingRules.DER || ruleSet == AsnEncodingRules.CER;
745 if (flag && contentOctets.Length < 15)
746 {
748 }
749 if (contentOctets.Length < 10)
750 {
751 throw new AsnContentException();
752 }
754 int year = ParseNonNegativeIntAndSlice(ref data, 4);
755 int month = ParseNonNegativeIntAndSlice(ref data, 2);
756 int day = ParseNonNegativeIntAndSlice(ref data, 2);
757 int hour = ParseNonNegativeIntAndSlice(ref data, 2);
758 int? num = null;
759 int? num2 = null;
760 ulong value = 0uL;
761 ulong num3 = 1uL;
762 byte b = byte.MaxValue;
763 TimeSpan? timeSpan = null;
764 bool flag2 = false;
765 byte b2 = 0;
766 while (b2 == 0 && data.Length != 0)
767 {
768 byte? b3 = GetNextState(data[0]);
769 if (!b3.HasValue)
770 {
771 if (!num.HasValue)
772 {
773 num = ParseNonNegativeIntAndSlice(ref data, 2);
774 continue;
775 }
776 if (num2.HasValue)
777 {
778 throw new AsnContentException();
779 }
781 }
782 else
783 {
784 b2 = b3.Value;
785 }
786 }
787 if (b2 == 1)
788 {
789 switch (data[0])
790 {
791 case 44:
792 if (flag)
793 {
795 }
796 break;
797 default:
798 throw new AsnContentException();
799 case 46:
800 break;
801 }
802 data = data.Slice(1);
803 if (data.IsEmpty)
804 {
805 throw new AsnContentException();
806 }
807 if (!Utf8Parser.TryParse(SliceAtMost(data, 12), out value, out int bytesConsumed, '\0') || bytesConsumed == 0)
808 {
809 throw new AsnContentException();
810 }
811 b = (byte)(value % 10);
812 for (int i = 0; i < bytesConsumed; i++)
813 {
814 num3 *= 10;
815 }
816 data = data.Slice(bytesConsumed);
817 uint value2;
818 while (Utf8Parser.TryParse(SliceAtMost(data, 9), out value2, out bytesConsumed, '\0'))
819 {
820 data = data.Slice(bytesConsumed);
821 b = (byte)(value2 % 10);
822 }
823 if (data.Length != 0)
824 {
825 byte? b4 = GetNextState(data[0]);
826 if (!b4.HasValue)
827 {
828 throw new AsnContentException();
829 }
830 b2 = b4.Value;
831 }
832 }
833 if (b2 == 2)
834 {
835 byte b5 = data[0];
836 data = data.Slice(1);
837 if (b5 == 90)
838 {
840 flag2 = true;
841 }
842 else
843 {
844 bool flag3 = b5 switch
845 {
846 43 => false,
847 45 => true,
848 _ => throw new AsnContentException(),
849 };
850 if (data.IsEmpty)
851 {
852 throw new AsnContentException();
853 }
855 int num4 = 0;
856 if (data.Length != 0)
857 {
859 }
860 if (num4 > 59)
861 {
862 throw new AsnContentException();
863 }
865 if (flag3)
866 {
868 }
870 }
871 }
872 if (!data.IsEmpty)
873 {
874 throw new AsnContentException();
875 }
876 if (flag)
877 {
878 if (!flag2 || !num2.HasValue)
879 {
881 }
882 if (b == 0)
883 {
885 }
886 }
887 double num5 = (double)value / (double)num3;
889 if (!num.HasValue)
890 {
891 num = 0;
892 num2 = 0;
893 if (value != 0L)
894 {
895 timeSpan3 = new TimeSpan((long)(num5 * 36000000000.0));
896 }
897 }
898 else if (!num2.HasValue)
899 {
900 num2 = 0;
901 if (value != 0L)
902 {
903 timeSpan3 = new TimeSpan((long)(num5 * 600000000.0));
904 }
905 }
906 else if (value != 0L)
907 {
908 timeSpan3 = new TimeSpan((long)(num5 * 10000000.0));
909 }
910 try
911 {
912 DateTimeOffset dateTimeOffset = (timeSpan.HasValue ? new DateTimeOffset(year, month, day, hour, num.Value, num2.Value, timeSpan.Value) : new DateTimeOffset(new DateTime(year, month, day, hour, num.Value, num2.Value)));
913 return dateTimeOffset + timeSpan3;
914 }
915 catch (Exception inner)
916 {
918 }
919 static byte? GetNextState(byte octet)
920 {
921 switch (octet)
922 {
923 case 43:
924 case 45:
925 case 90:
926 return 2;
927 case 44:
928 case 46:
929 return 1;
930 default:
931 return null;
932 }
933 }
934 }
935
940
942 {
943 int bytesConsumed2;
946 BigInteger result;
947 try
948 {
949 byte value = (byte)(((readOnlySpan[0] & 0x80u) != 0) ? byte.MaxValue : 0);
950 new Span<byte>(array, readOnlySpan.Length, array.Length - readOnlySpan.Length).Fill(value);
953 result = new BigInteger(array);
954 }
955 finally
956 {
958 }
960 return result;
961 }
962
964 {
966 {
967 value = (int)value2;
968 return true;
969 }
970 value = 0;
971 return false;
972 }
973
974 [CLSCompliant(false)]
976 {
978 {
979 value = (uint)value2;
980 return true;
981 }
982 value = 0u;
983 return false;
984 }
985
990
991 [CLSCompliant(false)]
996
1016
1018 {
1019 int bytesConsumed2;
1021 if (integerContents.Length > sizeLimit)
1022 {
1023 value = 0L;
1024 bytesConsumed = 0;
1025 return false;
1026 }
1027 long num = (((integerContents[0] & 0x80u) != 0) ? (-1) : 0);
1028 for (int i = 0; i < integerContents.Length; i++)
1029 {
1030 num <<= 8;
1031 num |= integerContents[i];
1032 }
1034 value = num;
1035 return true;
1036 }
1037
1039 {
1040 int bytesConsumed2;
1042 if ((readOnlySpan[0] & 0x80u) != 0)
1043 {
1044 bytesConsumed = 0;
1045 value = 0uL;
1046 return false;
1047 }
1048 if (readOnlySpan.Length > 1 && readOnlySpan[0] == 0)
1049 {
1050 readOnlySpan = readOnlySpan.Slice(1);
1051 }
1052 if (readOnlySpan.Length > sizeLimit)
1053 {
1054 bytesConsumed = 0;
1055 value = 0uL;
1056 return false;
1057 }
1058 ulong num = 0uL;
1059 for (int i = 0; i < readOnlySpan.Length; i++)
1060 {
1061 num <<= 8;
1062 num |= readOnlySpan[i];
1063 }
1065 value = num;
1066 return true;
1067 }
1068
1077
1079 {
1080 if (flagsEnumType == null)
1081 {
1082 throw new ArgumentNullException("flagsEnumType");
1083 }
1084 Type enumUnderlyingType = flagsEnumType.GetEnumUnderlyingType();
1085 if (!flagsEnumType.IsDefined(typeof(FlagsAttribute), inherit: false))
1086 {
1088 }
1092 {
1094 }
1095 Enum result;
1096 if (bytesWritten == 0)
1097 {
1098 result = (Enum)Enum.ToObject(flagsEnumType, 0);
1100 return result;
1101 }
1103 if (ruleSet == AsnEncodingRules.DER || ruleSet == AsnEncodingRules.CER)
1104 {
1105 byte b = valueSpan[bytesWritten - 1];
1106 byte b2 = (byte)(1 << unusedBitCount);
1107 if ((b & b2) == 0)
1108 {
1110 }
1111 }
1114 return result;
1115 }
1116
1141
1143 {
1144 long num = 0L;
1145 long num2 = 1L;
1146 for (int i = 0; i < valueSpan.Length; i++)
1147 {
1148 byte b = valueSpan[i];
1149 for (int num3 = 7; num3 >= 0; num3--)
1150 {
1151 int num4 = 1 << num3;
1152 if ((b & num4) != 0)
1153 {
1154 num |= num2;
1155 }
1156 num2 <<= 1;
1157 }
1158 }
1159 return num;
1160 }
1161
1163 {
1164 for (int i = 0; i < value.Length; i++)
1165 {
1166 byte b = value[i];
1167 byte b2 = 128;
1168 byte b3 = 0;
1169 while (b != 0)
1170 {
1171 b3 |= (byte)((b & 1) * b2);
1172 b >>= 1;
1173 b2 >>= 1;
1174 }
1175 value[i] = b3;
1176 }
1177 }
1178
1187
1189 {
1190 if (source.Overlaps(destination))
1191 {
1193 }
1195 {
1196 if (contents.Length > destination.Length)
1197 {
1198 bytesWritten = 0;
1199 bytesConsumed = 0;
1200 return false;
1201 }
1202 contents.CopyTo(destination);
1203 bytesWritten = contents.Length;
1205 return true;
1206 }
1207 int bytesRead;
1209 if (flag)
1210 {
1212 }
1213 else
1214 {
1215 bytesConsumed = 0;
1216 }
1217 return flag;
1218 }
1219
1233
1257
1264
1275
1280
1282 {
1283 bytesRead = 0;
1284 int num = 1000;
1286 Stack<(int, int, bool, int)> stack = null;
1287 int num2 = 0;
1290 while (true)
1291 {
1292 if (!readOnlySpan.IsEmpty)
1293 {
1296 {
1297 if (ruleSet == AsnEncodingRules.CER && num != 1000)
1298 {
1300 }
1302 int num3 = bytesRead2 + readOnlySpan2.Length;
1304 bytesRead += num3;
1305 num2 += readOnlySpan2.Length;
1306 num = readOnlySpan2.Length;
1307 if (ruleSet == AsnEncodingRules.CER && num > 1000)
1308 {
1310 }
1311 if (write)
1312 {
1314 destination2 = destination2.Slice(readOnlySpan2.Length);
1315 }
1316 continue;
1317 }
1319 {
1321 {
1322 if (ruleSet == AsnEncodingRules.CER)
1323 {
1325 }
1326 if (stack == null)
1327 {
1328 stack = new Stack<(int, int, bool, int)>();
1329 }
1330 if (!source.Overlaps(readOnlySpan, out var elementOffset))
1331 {
1332 throw new AsnContentException();
1333 }
1334 stack.Push((elementOffset, readOnlySpan.Length, isIndefinite, bytesRead));
1337 isIndefinite = !contentsLength.HasValue;
1338 continue;
1339 }
1340 throw new AsnContentException();
1341 }
1344 if (stack != null && stack.Count > 0)
1345 {
1346 (int, int, bool, int) tuple = stack.Pop();
1347 int item = tuple.Item1;
1348 int item2 = tuple.Item2;
1349 bool item3 = tuple.Item3;
1350 int item4 = tuple.Item4;
1351 readOnlySpan = source.Slice(item, item2).Slice(bytesRead);
1352 bytesRead += item4;
1354 continue;
1355 }
1356 }
1358 {
1359 throw new AsnContentException();
1360 }
1361 if (stack == null || stack.Count <= 0)
1362 {
1363 break;
1364 }
1365 (int, int, bool, int) tuple2 = stack.Pop();
1366 int item5 = tuple2.Item1;
1367 int item6 = tuple2.Item2;
1368 bool item7 = tuple2.Item3;
1369 int item8 = tuple2.Item4;
1370 readOnlySpan = source.Slice(item5, item6).Slice(bytesRead);
1372 bytesRead += item8;
1373 }
1374 return num2;
1375 }
1376
1378 {
1379 bytesRead = 0;
1381 if (dest.Length < num)
1382 {
1383 bytesWritten = 0;
1384 return false;
1385 }
1387 return true;
1388 }
1389
1391 {
1393 {
1394 return contents;
1395 }
1396 contents = source.Slice(headerLength);
1397 int num = contentLength ?? SeekEndOfContents(contents, ruleSet);
1398 if (tmpSpace.Length > 0 && num > tmpSpace.Length)
1399 {
1400 bool isIndefinite = !contentLength.HasValue;
1402 }
1403 if (num > tmpSpace.Length)
1404 {
1406 tmpSpace = rented;
1407 }
1409 {
1411 return tmpSpace.Slice(0, bytesWritten);
1412 }
1413 throw new AsnContentException();
1414 }
1415
1420
1422 {
1423 if (source[0] == 128)
1424 {
1425 throw new AsnContentException();
1426 }
1427 int num = -1;
1428 int i;
1429 for (i = 0; i < source.Length; i++)
1430 {
1431 if ((source[i] & 0x80) == 0)
1432 {
1433 num = i;
1434 break;
1435 }
1436 }
1437 if (num < 0)
1438 {
1439 throw new AsnContentException();
1440 }
1441 bytesRead = num + 1;
1442 long num2 = 0L;
1443 if (bytesRead <= 9)
1444 {
1445 for (i = 0; i < bytesRead; i++)
1446 {
1447 byte b = source[i];
1448 num2 <<= 7;
1449 num2 |= (byte)(b & 0x7F);
1450 }
1451 largeValue = null;
1452 smallValue = num2;
1453 return;
1454 }
1455 int num3 = (bytesRead / 8 + 1) * 7;
1457 Array.Clear(array, 0, array.Length);
1460 int num4 = bytesRead;
1461 i = bytesRead - 8;
1462 while (num4 > 0)
1463 {
1464 byte b2 = source[i];
1465 num2 <<= 7;
1466 num2 |= (byte)(b2 & 0x7F);
1467 i++;
1468 if (i >= num4)
1469 {
1471 destination2.Slice(0, 7).CopyTo(destination);
1472 destination = destination.Slice(7);
1473 num2 = 0L;
1474 num4 -= 8;
1475 i = Math.Max(0, num4 - 8);
1476 }
1477 }
1478 int num5 = array.Length - destination.Length;
1479 int num6 = num3 - num5;
1481 smallValue = null;
1483 }
1484
1486 {
1487 int bytesConsumed;
1489 if (source2.Length < 1)
1490 {
1491 throw new AsnContentException();
1492 }
1493 StringBuilder stringBuilder = new StringBuilder((byte)source2.Length * 4);
1495 if (smallValue.HasValue)
1496 {
1497 long num = smallValue.Value;
1498 byte value;
1499 if (num < 40)
1500 {
1501 value = 0;
1502 }
1503 else if (num < 80)
1504 {
1505 value = 1;
1506 num -= 40;
1507 }
1508 else
1509 {
1510 value = 2;
1511 num -= 80;
1512 }
1513 stringBuilder.Append(value);
1514 stringBuilder.Append('.');
1515 stringBuilder.Append(num);
1516 }
1517 else
1518 {
1520 byte value = 2;
1521 value2 -= (BigInteger)80;
1522 stringBuilder.Append(value);
1523 stringBuilder.Append('.');
1524 stringBuilder.Append(value2.ToString());
1525 }
1526 source2 = source2.Slice(bytesRead);
1527 while (!source2.IsEmpty)
1528 {
1530 stringBuilder.Append('.');
1531 if (smallValue.HasValue)
1532 {
1533 stringBuilder.Append(smallValue.Value);
1534 }
1535 else
1536 {
1537 stringBuilder.Append(largeValue.Value.ToString());
1538 }
1539 source2 = source2.Slice(bytesRead);
1540 }
1542 return stringBuilder.ToString();
1543 }
1544
1546 {
1547 int? contentsLength;
1548 int bytesRead;
1551 if (!tag.IsConstructed)
1552 {
1554 }
1555 if (contentsLength.HasValue)
1556 {
1557 if (contentsLength.Value + bytesRead > source.Length)
1558 {
1559 throw GetValidityException(LengthValidity.LengthExceedsInput);
1560 }
1564 }
1565 else
1566 {
1569 bytesConsumed = num + bytesRead + 2;
1570 }
1571 }
1572
1574 {
1575 int? contentsLength;
1576 int bytesRead;
1579 if (!tag.IsConstructed)
1580 {
1582 }
1583 int num;
1585 if (contentsLength.HasValue)
1586 {
1587 num = 0;
1589 }
1590 else
1591 {
1594 num = 2;
1595 }
1597 {
1600 while (!source2.IsEmpty)
1601 {
1606 {
1608 }
1609 y = readOnlySpan2;
1610 }
1611 }
1613 contentLength = readOnlySpan.Length;
1614 bytesConsumed = bytesRead + readOnlySpan.Length + num;
1615 }
1616
1632
1650
1656
1662
1664 {
1666 {
1667 if (contents.Length > destination.Length)
1668 {
1669 bytesWritten = 0;
1670 bytesConsumed = 0;
1671 return false;
1672 }
1673 contents.CopyTo(destination);
1674 bytesWritten = contents.Length;
1676 return true;
1677 }
1678 int bytesRead;
1680 if (flag)
1681 {
1683 }
1684 else
1685 {
1686 bytesConsumed = 0;
1687 }
1688 return flag;
1689 }
1690
1692 {
1693 if (source.Length == 0)
1694 {
1695 charsWritten = 0;
1696 return true;
1697 }
1698 fixed (byte* bytes = &MemoryMarshal.GetReference(source))
1699 {
1700 fixed (char* chars = &MemoryMarshal.GetReference(destination))
1701 {
1702 try
1703 {
1704 int charCount = encoding.GetCharCount(bytes, source.Length);
1705 if (charCount > destination.Length)
1706 {
1707 charsWritten = 0;
1708 return false;
1709 }
1710 charsWritten = encoding.GetChars(bytes, source.Length, chars, destination.Length);
1711 }
1712 catch (DecoderFallbackException inner)
1713 {
1715 }
1716 return true;
1717 }
1718 }
1719 }
1720
1722 {
1723 byte[] rented = null;
1724 int bytesConsumed2;
1726 string result;
1727 if (octetStringContents.Length == 0)
1728 {
1729 result = string.Empty;
1730 }
1731 else
1732 {
1733 fixed (byte* bytes = &MemoryMarshal.GetReference(octetStringContents))
1734 {
1735 try
1736 {
1737 result = encoding.GetString(bytes, octetStringContents.Length);
1738 }
1739 catch (DecoderFallbackException inner)
1740 {
1742 }
1743 }
1744 }
1745 if (rented != null)
1746 {
1748 }
1750 return result;
1751 }
1752
1773
1775 {
1776 switch (encodingType)
1777 {
1778 case UniversalTagNumber.UTF8String:
1779 case UniversalTagNumber.NumericString:
1780 case UniversalTagNumber.PrintableString:
1781 case UniversalTagNumber.TeletexString:
1782 case UniversalTagNumber.VideotexString:
1783 case UniversalTagNumber.IA5String:
1784 case UniversalTagNumber.GraphicString:
1785 case UniversalTagNumber.VisibleString:
1786 case UniversalTagNumber.GeneralString:
1787 case UniversalTagNumber.UniversalString:
1788 case UniversalTagNumber.BMPString:
1789 return true;
1790 default:
1791 return false;
1792 }
1793 }
1794
1813
1815 {
1816 if ((ruleSet == AsnEncodingRules.DER || ruleSet == AsnEncodingRules.CER) && contentOctets.Length != 13)
1817 {
1819 }
1820 if (contentOctets.Length < 11 || contentOctets.Length > 17 || (contentOctets.Length & 1) != 1)
1821 {
1822 throw new AsnContentException();
1823 }
1825 int num = ParseNonNegativeIntAndSlice(ref data, 2);
1826 int month = ParseNonNegativeIntAndSlice(ref data, 2);
1827 int day = ParseNonNegativeIntAndSlice(ref data, 2);
1828 int hour = ParseNonNegativeIntAndSlice(ref data, 2);
1829 int minute = ParseNonNegativeIntAndSlice(ref data, 2);
1830 int second = 0;
1831 int hours = 0;
1832 int num2 = 0;
1833 bool flag = false;
1834 if (contentOctets.Length == 17 || contentOctets.Length == 13)
1835 {
1836 second = ParseNonNegativeIntAndSlice(ref data, 2);
1837 }
1838 if (contentOctets.Length == 11 || contentOctets.Length == 13)
1839 {
1840 if (data[0] != 90)
1841 {
1842 throw new AsnContentException();
1843 }
1844 }
1845 else
1846 {
1847 if (data[0] == 45)
1848 {
1849 flag = true;
1850 }
1851 else if (data[0] != 43)
1852 {
1853 throw new AsnContentException();
1854 }
1855 data = data.Slice(1);
1858 }
1859 if (num2 > 59)
1860 {
1861 throw new AsnContentException();
1862 }
1863 TimeSpan timeSpan = new TimeSpan(hours, num2, 0);
1864 if (flag)
1865 {
1866 timeSpan = -timeSpan;
1867 }
1868 int num3 = twoDigitYearMax / 100;
1869 if (num > twoDigitYearMax % 100)
1870 {
1871 num3--;
1872 }
1873 int year = num3 * 100 + num;
1874 try
1875 {
1876 return new DateTimeOffset(year, month, day, hour, minute, second, timeSpan);
1877 }
1878 catch (Exception inner)
1879 {
1881 }
1882 }
1883}
static unsafe void Clear(Array array)
Definition Array.cs:755
static bool TryReadUInt16BigEndian(ReadOnlySpan< byte > source, out ushort value)
static void WriteInt64LittleEndian(Span< byte > destination, long value)
static bool TryParse(ReadOnlySpan< byte > source, out bool value, out int bytesConsumed, char standardFormat='\0')
void CopyTo(KeyValuePair< TKey, TValue >[] array, int index)
static object ToObject(Type enumType, object value)
Definition Enum.cs:874
static Encoding GetEncoding(UniversalTagNumber encodingType)
static bool TryReadUnsignedInteger(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, int sizeLimit, Asn1Tag expectedTag, UniversalTagNumber tagNumber, out ulong value, out int bytesConsumed)
static TFlagsEnum ReadNamedBitListValue< TFlagsEnum >(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int bytesConsumed, Asn1Tag? expectedTag=null)
static void ValidateEndOfContents(Asn1Tag tag, int? length, int headerLength)
static bool TryReadCharacterStringCore(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Asn1Tag expectedTag, UniversalTagNumber universalTagNumber, Encoding encoding, Span< char > destination, out int bytesConsumed, out int charsWritten)
static ? int ReadLength(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int bytesConsumed)
static ReadOnlyMemory< byte > Slice(ReadOnlyMemory< byte > bigger, ReadOnlySpan< byte > smaller)
static unsafe string ReadCharacterStringCore(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Asn1Tag expectedTag, UniversalTagNumber universalTagNumber, Encoding encoding, out int bytesConsumed)
static void ReverseBitsPerByte(Span< byte > value)
static DateTimeOffset ParseGeneralizedTime(AsnEncodingRules ruleSet, ReadOnlySpan< byte > contentOctets)
static DateTimeOffset ReadGeneralizedTime(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int bytesConsumed, Asn1Tag? expectedTag=null)
static unsafe bool TryReadCharacterStringCore(ReadOnlySpan< byte > source, Span< char > destination, Encoding encoding, out int charsWritten)
static bool TryReadUInt32(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out uint value, out int bytesConsumed, Asn1Tag? expectedTag=null)
static int ParseNonNegativeInt(ReadOnlySpan< byte > data)
static bool ReadBoolean(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int bytesConsumed, Asn1Tag? expectedTag=null)
static bool TryReadCharacterStringBytes(ReadOnlySpan< byte > source, Span< byte > destination, AsnEncodingRules ruleSet, Asn1Tag expectedTag, out int bytesConsumed, out int bytesWritten)
static TEnum ReadEnumeratedValue< TEnum >(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int bytesConsumed, Asn1Tag? expectedTag=null)
static ReadOnlySpan< byte > ReadIntegerBytes(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int bytesConsumed, Asn1Tag? expectedTag=null)
static int SeekEndOfContents(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet)
static string ReadObjectIdentifier(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Asn1Tag? expectedTag, out int totalBytesRead)
static AsnContentException GetValidityException(LengthValidity validity)
static void CopyConstructedBitString(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Span< byte > destination, bool isIndefinite, out int unusedBitCount, out int bytesRead, out int bytesWritten)
static ReadOnlySpan< byte > SliceAtMost(ReadOnlySpan< byte > source, int longestPermitted)
static LengthDecodeStatus DecodeLength(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int? length, out int bytesRead)
static bool TryReadCharacterString(ReadOnlySpan< byte > source, Span< char > destination, AsnEncodingRules ruleSet, UniversalTagNumber encodingType, out int bytesConsumed, out int charsWritten, Asn1Tag? expectedTag=null)
static bool IsCharacterStringEncodingType(UniversalTagNumber encodingType)
static LengthValidity ValidateLength(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Asn1Tag localTag, int? encodedLength, out int actualLength, out int bytesConsumed)
static bool TryReadSignedInteger(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, int sizeLimit, Asn1Tag expectedTag, UniversalTagNumber tagNumber, out long value, out int bytesConsumed)
static BigInteger ReadInteger(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int bytesConsumed, Asn1Tag? expectedTag=null)
static Enum ReadEnumeratedValue(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Type enumType, out int bytesConsumed, Asn1Tag? expectedTag=null)
static int CountConstructedBitString(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, bool isIndefinite)
static bool TryReadPrimitiveBitStringCore(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Asn1Tag expectedTag, out int? contentsLength, out int headerLength, out int unusedBitCount, out ReadOnlySpan< byte > value, out int bytesConsumed, out byte normalizedLastByte)
static Enum ReadNamedBitListValue(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Type flagsEnumType, out int bytesConsumed, Asn1Tag? expectedTag=null)
static DateTimeOffset ParseUtcTime(ReadOnlySpan< byte > contentOctets, AsnEncodingRules ruleSet, int twoDigitYearMax)
static void ReadSetOf(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int contentOffset, out int contentLength, out int bytesConsumed, bool skipSortOrderValidation=false, Asn1Tag? expectedTag=null)
static bool TryReadEncodedValue(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out Asn1Tag tag, out int contentOffset, out int contentLength, out int bytesConsumed)
Definition AsnDecoder.cs:34
static byte[] ReadBitString(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int unusedBitCount, out int bytesConsumed, Asn1Tag? expectedTag=null)
static byte[] ReadOctetString(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int bytesConsumed, Asn1Tag? expectedTag=null)
static void ReadSubIdentifier(ReadOnlySpan< byte > source, out int bytesRead, out long? smallValue, out BigInteger? largeValue)
static bool TryCopyConstructedOctetStringContents(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Span< byte > dest, bool isIndefinite, out int bytesRead, out int bytesWritten)
static DateTimeOffset ReadUtcTime(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int bytesConsumed, int twoDigitYearMax=2049, Asn1Tag? expectedTag=null)
static ReadOnlySpan< byte > Slice(ReadOnlySpan< byte > source, int offset, int length)
static int ParseNonNegativeIntAndSlice(ref ReadOnlySpan< byte > data, int bytesToRead)
static bool TryReadPrimitiveOctetStringCore(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Asn1Tag expectedTag, UniversalTagNumber universalTagNumber, out int? contentLength, out int headerLength, out ReadOnlySpan< byte > contents, out int bytesConsumed)
static ReadOnlySpan< byte > ReadEnumeratedBytes(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int bytesConsumed, Asn1Tag? expectedTag=null)
static void ReadNull(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int bytesConsumed, Asn1Tag? expectedTag=null)
static string ReadCharacterString(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, UniversalTagNumber encodingType, out int bytesConsumed, Asn1Tag? expectedTag=null)
static ReadOnlySpan< byte > GetPrimitiveContentSpan(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Asn1Tag expectedTag, UniversalTagNumber tagNumber, out int bytesConsumed)
Definition AsnDecoder.cs:78
static BitArray ReadNamedBitList(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int bytesConsumed, Asn1Tag? expectedTag=null)
static void CopyConstructedOctetString(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Span< byte > destination, bool isIndefinite, out int bytesRead, out int bytesWritten)
static bool TryCopyConstructedBitStringValue(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Span< byte > dest, bool isIndefinite, out int unusedBitCount, out int bytesRead, out int bytesWritten)
static void CopyBitStringValue(ReadOnlySpan< byte > value, byte normalizedLastByte, Span< byte > destination)
static bool TryReadPrimitiveCharacterStringBytes(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Asn1Tag expectedTag, out ReadOnlySpan< byte > value, out int bytesConsumed)
static ReadOnlySpan< byte > GetIntegerContents(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Asn1Tag expectedTag, UniversalTagNumber tagNumber, out int bytesConsumed)
static void CheckEncodingRules(AsnEncodingRules ruleSet)
static long InterpretNamedBitListReversed(ReadOnlySpan< byte > valueSpan)
static string ReadObjectIdentifier(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int bytesConsumed, Asn1Tag? expectedTag=null)
static bool TryReadPrimitiveOctetString(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out ReadOnlySpan< byte > value, out int bytesConsumed, Asn1Tag? expectedTag=null)
static ReadOnlySpan< byte > GetOctetStringContents(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Asn1Tag expectedTag, UniversalTagNumber universalTagNumber, out int bytesConsumed, ref byte[] rented, Span< byte > tmpSpace=default(Span< byte >))
static ReadOnlySpan< byte > Slice(ReadOnlySpan< byte > source, int offset, int? length)
static void CheckExpectedTag(Asn1Tag tag, Asn1Tag expectedTag, UniversalTagNumber tagNumber)
static bool TryReadCharacterStringBytesCore(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Asn1Tag expectedTag, UniversalTagNumber universalTagNumber, Span< byte > destination, out int bytesConsumed, out int bytesWritten)
delegate void BitStringCopyAction(ReadOnlySpan< byte > value, byte normalizedLastByte, Span< byte > destination)
static bool TryReadInt32(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int value, out int bytesConsumed, Asn1Tag? expectedTag=null)
static void ReadSequence(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int contentOffset, out int contentLength, out int bytesConsumed, Asn1Tag? expectedTag=null)
static bool TryReadUInt64(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out ulong value, out int bytesConsumed, Asn1Tag? expectedTag=null)
static bool TryReadInt64(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out long value, out int bytesConsumed, Asn1Tag? expectedTag=null)
static Asn1Tag ReadEncodedValue(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int contentOffset, out int contentLength, out int bytesConsumed)
Definition AsnDecoder.cs:57
static bool TryReadOctetString(ReadOnlySpan< byte > source, Span< byte > destination, AsnEncodingRules ruleSet, out int bytesConsumed, out int bytesWritten, Asn1Tag? expectedTag=null)
static bool TryReadLength(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int? length, out int bytesRead)
static bool TryReadPrimitiveBitString(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int unusedBitCount, out ReadOnlySpan< byte > value, out int bytesConsumed, Asn1Tag? expectedTag=null)
static bool TryReadBitString(ReadOnlySpan< byte > source, Span< byte > destination, AsnEncodingRules ruleSet, out int unusedBitCount, out int bytesConsumed, out int bytesWritten, Asn1Tag? expectedTag=null)
static int CopyConstructedOctetString(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Span< byte > destination, bool write, bool isIndefinite, out int bytesRead)
static void ParsePrimitiveBitStringContents(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int unusedBitCount, out ReadOnlySpan< byte > value, out byte normalizedLastByte)
static Asn1Tag ReadTagAndLength(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, out int? contentsLength, out int bytesRead)
static int CountConstructedOctetString(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, bool isIndefinite)
static int ProcessConstructedBitString(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet, Span< byte > destination, BitStringCopyAction copyAction, bool isIndefinite, out int lastUnusedBitCount, out int bytesRead)
static void Reverse(Span< byte > span)
Definition AsnWriter.cs:459
int Compare(ReadOnlyMemory< byte > x, ReadOnlyMemory< byte > y)
static byte Min(byte val1, byte val2)
Definition Math.cs:912
static byte Max(byte val1, byte val2)
Definition Math.cs:738
static int SizeOf(object structure)
Definition Marshal.cs:697
static string ContentException_InvalidUnderCerOrDer_TryBer
Definition SR.cs:56
static string Argument_Tag_NotCharacterString
Definition SR.cs:26
static string ContentException_CerRequiresIndefiniteLength
Definition SR.cs:46
static string ContentException_PrimitiveEncodingRequired
Definition SR.cs:70
static string ContentException_EnumeratedValueTooBig
Definition SR.cs:52
static string ContentException_WrongTag
Definition SR.cs:76
static string ContentException_NamedBitListValueTooBig
Definition SR.cs:68
static string ContentException_DefaultMessage
Definition SR.cs:50
static string ContentException_InvalidUnderCer_TryBerOrDer
Definition SR.cs:54
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string ContentException_ConstructedEncodingRequired
Definition SR.cs:48
static string Argument_EnumeratedValueRequiresNonFlagsEnum
Definition SR.cs:16
static string ContentException_LengthExceedsPayload
Definition SR.cs:62
static string Argument_SourceOverlapsDestination
Definition SR.cs:24
static string Argument_EnumeratedValueBackingTypeNotSupported
Definition SR.cs:18
static string ContentException_LengthTooBig
Definition SR.cs:66
static string ContentException_LengthRuleSetConstraint
Definition SR.cs:64
static string Argument_NamedBitListRequiresFlagsEnum
Definition SR.cs:22
static string ContentException_InvalidUnderDer_TryBerOrCer
Definition SR.cs:58
static string ContentException_SetOfNotSorted
Definition SR.cs:72
static string Argument_UniversalValueIsFixed
Definition SR.cs:32
Definition SR.cs:7
static void Return(byte[] array, int clearSize=-1)
Definition CryptoPool.cs:12
static byte[] Rent(int minimumLength)
Definition CryptoPool.cs:7
virtual int GetCharCount(byte[] bytes)
Definition Encoding.cs:887
virtual char[] GetChars(byte[] bytes)
Definition Encoding.cs:921
unsafe string GetString(byte *bytes, int byteCount)
Definition Encoding.cs:973
static readonly Asn1Tag Integer
Definition Asn1Tag.cs:13
static readonly Asn1Tag Enumerated
Definition Asn1Tag.cs:27
static readonly Asn1Tag ConstructedBitString
Definition Asn1Tag.cs:17
static readonly Asn1Tag Sequence
Definition Asn1Tag.cs:29
static readonly Asn1Tag ConstructedOctetString
Definition Asn1Tag.cs:21
static Asn1Tag Decode(ReadOnlySpan< byte > source, out int bytesConsumed)
Definition Asn1Tag.cs:141
static bool TryDecode(ReadOnlySpan< byte > source, out Asn1Tag tag, out int bytesConsumed)
Definition Asn1Tag.cs:87
static readonly Asn1Tag PrimitiveBitString
Definition Asn1Tag.cs:15
static readonly Asn1Tag SetOf
Definition Asn1Tag.cs:31
static readonly Asn1Tag UtcTime
Definition Asn1Tag.cs:33
static readonly Asn1Tag PrimitiveOctetString
Definition Asn1Tag.cs:19
static readonly Asn1Tag GeneralizedTime
Definition Asn1Tag.cs:35
static readonly Asn1Tag ObjectIdentifier
Definition Asn1Tag.cs:25
static readonly Asn1Tag Boolean
Definition Asn1Tag.cs:11
static readonly Asn1Tag EndOfContents
Definition Asn1Tag.cs:9
static readonly Asn1Tag Null
Definition Asn1Tag.cs:23
static readonly TimeSpan Zero
Definition TimeSpan.cs:21