Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ValidityAsn.cs
Go to the documentation of this file.
2
4
5internal struct ValidityAsn
6{
7 internal TimeAsn NotBefore;
8
9 internal TimeAsn NotAfter;
10
11 internal void Encode(AsnWriter writer)
12 {
14 }
15
16 internal void Encode(AsnWriter writer, Asn1Tag tag)
17 {
18 writer.PushSequence(tag);
21 writer.PopSequence(tag);
22 }
23
24 internal static void Decode(ref System.Formats.Asn1.AsnValueReader reader, ReadOnlyMemory<byte> rebind, out ValidityAsn decoded)
25 {
26 Decode(ref reader, Asn1Tag.Sequence, rebind, out decoded);
27 }
28
29 internal static void Decode(ref System.Formats.Asn1.AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory<byte> rebind, out ValidityAsn decoded)
30 {
31 try
32 {
33 DecodeCore(ref reader, expectedTag, rebind, out decoded);
34 }
35 catch (AsnContentException inner)
36 {
38 }
39 }
40
41 private static void DecodeCore(ref System.Formats.Asn1.AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory<byte> rebind, out ValidityAsn decoded)
42 {
43 decoded = default(ValidityAsn);
44 System.Formats.Asn1.AsnValueReader reader2 = reader.ReadSequence(expectedTag);
45 TimeAsn.Decode(ref reader2, rebind, out decoded.NotBefore);
46 TimeAsn.Decode(ref reader2, rebind, out decoded.NotAfter);
47 reader2.ThrowIfNotEmpty();
48 }
49
50 public ValidityAsn(DateTimeOffset notBefore, DateTimeOffset notAfter)
51 {
52 NotBefore = new TimeAsn(notBefore);
53 NotAfter = new TimeAsn(notAfter);
54 }
55}
static string Cryptography_Der_Invalid_Encoding
Definition SR.cs:50
Definition SR.cs:7
static readonly Asn1Tag Sequence
Definition Asn1Tag.cs:29
AsnValueReader ReadSequence(Asn1Tag? expectedTag=null)
static void Decode(ref System.Formats.Asn1.AsnValueReader reader, ReadOnlyMemory< byte > rebind, out TimeAsn decoded)
Definition TimeAsn.cs:38
static void Decode(ref System.Formats.Asn1.AsnValueReader reader, ReadOnlyMemory< byte > rebind, out ValidityAsn decoded)
static void DecodeCore(ref System.Formats.Asn1.AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory< byte > rebind, out ValidityAsn decoded)
ValidityAsn(DateTimeOffset notBefore, DateTimeOffset notAfter)
static void Decode(ref System.Formats.Asn1.AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory< byte > rebind, out ValidityAsn decoded)