Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EncryptedPrivateKeyInfoAsn.cs
Go to the documentation of this file.
2
4
5internal struct EncryptedPrivateKeyInfoAsn
6{
8
10
12 {
13 Decode(ref reader, Asn1Tag.Sequence, rebind, out decoded);
14 }
15
17 {
18 try
19 {
20 DecodeCore(ref reader, expectedTag, rebind, out decoded);
21 }
22 catch (AsnContentException inner)
23 {
25 }
26 }
27
29 {
31 System.Formats.Asn1.AsnValueReader reader2 = reader.ReadSequence(expectedTag);
32 ReadOnlySpan<byte> span = rebind.Span;
33 System.Security.Cryptography.Asn1.AlgorithmIdentifierAsn.Decode(ref reader2, rebind, out decoded.EncryptionAlgorithm);
34 if (reader2.TryReadPrimitiveOctetString(out var value))
35 {
36 decoded.EncryptedData = (span.Overlaps(value, out var elementOffset) ? rebind.Slice(elementOffset, value.Length) : ((ReadOnlyMemory<byte>)value.ToArray()));
37 }
38 else
39 {
40 decoded.EncryptedData = reader2.ReadOctetString();
41 }
42 reader2.ThrowIfNotEmpty();
43 }
44}
static string Cryptography_Der_Invalid_Encoding
Definition SR.cs:50
Definition SR.cs:7
static readonly Asn1Tag Sequence
Definition Asn1Tag.cs:29
bool TryReadPrimitiveOctetString(out ReadOnlySpan< byte > value, Asn1Tag? expectedTag=null)
byte[] ReadOctetString(Asn1Tag? expectedTag=null)
AsnValueReader ReadSequence(Asn1Tag? expectedTag=null)
unsafe ReadOnlySpan< T > Span
ReadOnlyMemory< T > Slice(int start)
static void Decode(ref AsnValueReader reader, ReadOnlyMemory< byte > rebind, out AlgorithmIdentifierAsn decoded)
System.Security.Cryptography.Asn1.AlgorithmIdentifierAsn EncryptionAlgorithm
static void Decode(ref System.Formats.Asn1.AsnValueReader reader, ReadOnlyMemory< byte > rebind, out System.Security.Cryptography.Asn1.EncryptedPrivateKeyInfoAsn decoded)
static void DecodeCore(ref System.Formats.Asn1.AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory< byte > rebind, out System.Security.Cryptography.Asn1.EncryptedPrivateKeyInfoAsn decoded)
static void Decode(ref AsnValueReader reader, ReadOnlyMemory< byte > rebind, out EncryptedPrivateKeyInfoAsn decoded)
static void Decode(ref System.Formats.Asn1.AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory< byte > rebind, out System.Security.Cryptography.Asn1.EncryptedPrivateKeyInfoAsn decoded)
static void DecodeCore(ref AsnValueReader reader, Asn1Tag expectedTag, ReadOnlyMemory< byte > rebind, out EncryptedPrivateKeyInfoAsn decoded)