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

◆ ReadSubjectPublicKeyInfo< TRet >() [1/2]

static void System.Security.Cryptography.KeyFormatHelper.ReadSubjectPublicKeyInfo< TRet > ( string[] validOids,
ReadOnlyMemory< byte > source,
KeyReader< TRet > keyReader,
out int bytesRead,
out TRet ret )
inlinestaticprivate

Definition at line 43 of file KeyFormatHelper.cs.

44 {
45 int length;
47 try
48 {
51 SubjectPublicKeyInfoAsn.Decode(ref reader, source, out decoded);
52 }
53 catch (AsnContentException inner)
54 {
55 throw new CryptographicException(System.SR.Cryptography_Der_Invalid_Encoding, inner);
56 }
57 if (Array.IndexOf(validOids, decoded.Algorithm.Algorithm) < 0)
58 {
59 throw new CryptographicException(System.SR.Cryptography_NotValidPublicOrPrivateKey);
60 }
61 keyReader(decoded.SubjectPublicKey, in decoded.Algorithm, out ret);
62 bytesRead = length;
63 }
static string Cryptography_Der_Invalid_Encoding
Definition SR.cs:50
static string Cryptography_NotValidPublicOrPrivateKey
Definition SR.cs:122
Definition SR.cs:7
ReadOnlySpan< byte > PeekEncodedValue()
static void Decode(ref AsnValueReader reader, ReadOnlyMemory< byte > rebind, out SubjectPublicKeyInfoAsn decoded)

References System.Security.Cryptography.Asn1.AlgorithmIdentifierAsn.Algorithm, System.Security.Cryptography.Asn1.SubjectPublicKeyInfoAsn.Algorithm, System.SR.Cryptography_Der_Invalid_Encoding, System.SR.Cryptography_NotValidPublicOrPrivateKey, System.Security.Cryptography.Asn1.SubjectPublicKeyInfoAsn.Decode(), System.Array.IndexOf(), System.length, System.ReadOnlySpan< T >.Length, System.Formats.Asn1.AsnValueReader.PeekEncodedValue(), System.source, and System.Security.Cryptography.Asn1.SubjectPublicKeyInfoAsn.SubjectPublicKey.