Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DssParms.cs
Go to the documentation of this file.
3
5
6internal struct DssParms
7{
8 internal BigInteger P;
9
10 internal BigInteger Q;
11
12 internal BigInteger G;
13
14 internal static DssParms Decode(ReadOnlyMemory<byte> encoded, AsnEncodingRules ruleSet)
15 {
16 return Decode(Asn1Tag.Sequence, encoded, ruleSet);
17 }
18
19 internal static DssParms Decode(Asn1Tag expectedTag, ReadOnlyMemory<byte> encoded, AsnEncodingRules ruleSet)
20 {
21 try
22 {
23 AsnValueReader reader = new AsnValueReader(encoded.Span, ruleSet);
24 DecodeCore(ref reader, expectedTag, encoded, out var decoded);
25 reader.ThrowIfNotEmpty();
26 return decoded;
27 }
28 catch (AsnContentException inner)
29 {
31 }
32 }
33
34 private static void DecodeCore(ref AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory<byte> rebind, out DssParms decoded)
35 {
36 decoded = default(DssParms);
37 AsnValueReader asnValueReader = reader.ReadSequence(expectedTag);
38 decoded.P = asnValueReader.ReadInteger();
39 decoded.Q = asnValueReader.ReadInteger();
40 decoded.G = asnValueReader.ReadInteger();
41 asnValueReader.ThrowIfNotEmpty();
42 }
43}
static string Cryptography_Der_Invalid_Encoding
Definition SR.cs:50
Definition SR.cs:7
static readonly Asn1Tag Sequence
Definition Asn1Tag.cs:29
BigInteger ReadInteger(Asn1Tag? expectedTag=null)
AsnValueReader ReadSequence(Asn1Tag? expectedTag=null)
unsafe ReadOnlySpan< T > Span
static DssParms Decode(ReadOnlyMemory< byte > encoded, AsnEncodingRules ruleSet)
Definition DssParms.cs:14
static DssParms Decode(Asn1Tag expectedTag, ReadOnlyMemory< byte > encoded, AsnEncodingRules ruleSet)
Definition DssParms.cs:19
static void DecodeCore(ref AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory< byte > rebind, out DssParms decoded)
Definition DssParms.cs:34