Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Pbkdf2SaltChoice.cs
Go to the documentation of this file.
2
4
5internal struct Pbkdf2SaltChoice
6{
8
10
12 {
13 try
14 {
15 DecodeCore(ref reader, rebind, out decoded);
16 }
17 catch (AsnContentException inner)
18 {
20 }
21 }
22
24 {
26 Asn1Tag asn1Tag = reader.PeekTag();
27 ReadOnlySpan<byte> span = rebind.Span;
29 {
30 if (reader.TryReadPrimitiveOctetString(out var value))
31 {
32 decoded.Specified = (span.Overlaps(value, out var elementOffset) ? rebind.Slice(elementOffset, value.Length) : ((ReadOnlyMemory<byte>)value.ToArray()));
33 }
34 else
35 {
36 decoded.Specified = reader.ReadOctetString();
37 }
38 return;
39 }
41 {
42 System.Security.Cryptography.Asn1.AlgorithmIdentifierAsn.Decode(ref reader, rebind, out var decoded2);
43 decoded.OtherSource = decoded2;
44 return;
45 }
46 throw new CryptographicException();
47 }
48}
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 PrimitiveOctetString
Definition Asn1Tag.cs:19
bool HasSameClassAndValue(Asn1Tag other)
Definition Asn1Tag.cs:251
unsafe ReadOnlySpan< T > Span
ReadOnlyMemory< T > Slice(int start)
static void Decode(ref AsnValueReader reader, ReadOnlyMemory< byte > rebind, out AlgorithmIdentifierAsn decoded)
static void Decode(ref System.Formats.Asn1.AsnValueReader reader, ReadOnlyMemory< byte > rebind, out System.Security.Cryptography.Asn1.Pbkdf2SaltChoice decoded)
static void DecodeCore(ref System.Formats.Asn1.AsnValueReader reader, ReadOnlyMemory< byte > rebind, out System.Security.Cryptography.Asn1.Pbkdf2SaltChoice decoded)
static void DecodeCore(ref AsnValueReader reader, ReadOnlyMemory< byte > rebind, out Pbkdf2SaltChoice decoded)
System.Security.Cryptography.Asn1.? AlgorithmIdentifierAsn OtherSource