Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ECDomainParameters.cs
Go to the documentation of this file.
2
4
5internal struct ECDomainParameters
6{
8
9 internal string Named;
10
11 internal void Encode(AsnWriter writer)
12 {
13 bool flag = false;
14 if (Specified.HasValue)
15 {
16 if (flag)
17 {
18 throw new CryptographicException();
19 }
20 Specified.Value.Encode(writer);
21 flag = true;
22 }
23 if (Named != null)
24 {
25 if (flag)
26 {
27 throw new CryptographicException();
28 }
29 try
30 {
31 writer.WriteObjectIdentifier(Named);
32 }
33 catch (ArgumentException inner)
34 {
36 }
37 flag = true;
38 }
39 if (!flag)
40 {
41 throw new CryptographicException();
42 }
43 }
44
46 {
47 try
48 {
50 DecodeCore(ref reader, encoded, out var decoded);
51 reader.ThrowIfNotEmpty();
52 return decoded;
53 }
54 catch (AsnContentException inner)
55 {
57 }
58 }
59
61 {
62 try
63 {
64 DecodeCore(ref reader, rebind, out decoded);
65 }
66 catch (AsnContentException inner)
67 {
69 }
70 }
71
73 {
75 Asn1Tag asn1Tag = reader.PeekTag();
77 {
78 System.Security.Cryptography.Asn1.SpecifiedECDomain.Decode(ref reader, rebind, out var decoded2);
79 decoded.Specified = decoded2;
80 return;
81 }
83 {
84 decoded.Named = reader.ReadObjectIdentifier();
85 return;
86 }
87 throw new CryptographicException();
88 }
89}
static string Cryptography_Der_Invalid_Encoding
Definition SR.cs:50
Definition SR.cs:7
static readonly Asn1Tag Sequence
Definition Asn1Tag.cs:29
static readonly Asn1Tag ObjectIdentifier
Definition Asn1Tag.cs:25
bool HasSameClassAndValue(Asn1Tag other)
Definition Asn1Tag.cs:251
unsafe ReadOnlySpan< T > Span
System.Security.Cryptography.Asn1.? SpecifiedECDomain Specified
static void Decode(ref System.Formats.Asn1.AsnValueReader reader, ReadOnlyMemory< byte > rebind, out System.Security.Cryptography.Asn1.ECDomainParameters decoded)
static void DecodeCore(ref AsnValueReader reader, ReadOnlyMemory< byte > rebind, out ECDomainParameters decoded)
static System.Security.Cryptography.Asn1.ECDomainParameters Decode(ReadOnlyMemory< byte > encoded, AsnEncodingRules ruleSet)
static void DecodeCore(ref System.Formats.Asn1.AsnValueReader reader, ReadOnlyMemory< byte > rebind, out System.Security.Cryptography.Asn1.ECDomainParameters decoded)
static void Decode(ref AsnValueReader reader, ReadOnlyMemory< byte > rebind, out SpecifiedECDomain decoded)