Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DecodeCore() [1/2]

static void System.Security.Cryptography.Asn1.PrivateKeyInfoAsn.DecodeCore ( ref AsnValueReader reader,
Asn1Tag expectedTag,
ReadOnlyMemory< byte > rebind,
out PrivateKeyInfoAsn decoded )
inlinestaticprivate

Definition at line 53 of file PrivateKeyInfoAsn.cs.

54 {
55 decoded = default(PrivateKeyInfoAsn);
56 AsnValueReader reader2 = reader.ReadSequence(expectedTag);
58 if (!reader2.TryReadInt32(out decoded.Version))
59 {
60 reader2.ThrowIfNotEmpty();
61 }
62 AlgorithmIdentifierAsn.Decode(ref reader2, rebind, out decoded.PrivateKeyAlgorithm);
63 if (reader2.TryReadPrimitiveOctetString(out var value))
64 {
65 decoded.PrivateKey = (span.Overlaps(value, out var elementOffset) ? rebind.Slice(elementOffset, value.Length) : ((ReadOnlyMemory<byte>)value.ToArray()));
66 }
67 else
68 {
69 decoded.PrivateKey = reader2.ReadOctetString();
70 }
71 if (reader2.HasData && reader2.PeekTag().HasSameClassAndValue(new Asn1Tag(TagClass.ContextSpecific, 0)))
72 {
73 AsnValueReader reader3 = reader2.ReadSetOf(new Asn1Tag(TagClass.ContextSpecific, 0));
75 while (reader3.HasData)
76 {
77 AttributeAsn.Decode(ref reader3, rebind, out var decoded2);
78 list.Add(decoded2);
79 }
80 decoded.Attributes = list.ToArray();
81 }
82 reader2.ThrowIfNotEmpty();
83 }

References System.Security.Cryptography.Asn1.AlgorithmIdentifierAsn.Decode(), System.Security.Cryptography.Asn1.AttributeAsn.Decode(), System.list, and System.value.

Referenced by System.Security.Cryptography.Asn1.PrivateKeyInfoAsn.Decode(), and System.Security.Cryptography.Asn1.PrivateKeyInfoAsn.Decode().