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

◆ ReadSubjectPublicKeyInfo()

static ReadOnlyMemory< byte > System.Security.Cryptography.KeyFormatHelper.ReadSubjectPublicKeyInfo ( string[] validOids,
ReadOnlyMemory< byte > source,
out int bytesRead )
inlinestaticpackage

Definition at line 21 of file KeyFormatHelper.cs.

22 {
23 int length;
25 try
26 {
29 SubjectPublicKeyInfoAsn.Decode(ref reader, source, out decoded);
30 }
31 catch (AsnContentException inner)
32 {
33 throw new CryptographicException(System.SR.Cryptography_Der_Invalid_Encoding, inner);
34 }
35 if (Array.IndexOf(validOids, decoded.Algorithm.Algorithm) < 0)
36 {
37 throw new CryptographicException(System.SR.Cryptography_NotValidPublicOrPrivateKey);
38 }
39 bytesRead = length;
40 return decoded.SubjectPublicKey;
41 }
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.

Referenced by System.Security.Cryptography.ECDiffieHellman.ImportSubjectPublicKeyInfo(), System.Security.Cryptography.ECDsa.ImportSubjectPublicKeyInfo(), System.Security.Cryptography.RSAKeyFormatHelper.ReadSubjectPublicKeyInfo(), System.Security.Cryptography.DSAKeyFormatHelper.ReadSubjectPublicKeyInfo(), and System.Security.Cryptography.KeyFormatHelper.ReadSubjectPublicKeyInfo< TRet >().