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

◆ DecodeSubjectPublicKeyInfo()

static unsafe int System.Security.Cryptography.X509Certificates.PublicKey.DecodeSubjectPublicKeyInfo ( ReadOnlySpan< byte > source,
out Oid oid,
out AsnEncodedData parameters,
out AsnEncodedData keyValue )
inlinestaticprivate

Definition at line 169 of file PublicKey.cs.

170 {
171 fixed (byte* pointer = &MemoryMarshal.GetReference(source))
172 {
173 using MemoryManager<byte> memoryManager = new System.Buffers.PointerMemoryManager<byte>(pointer, source.Length);
175 int length;
177 try
178 {
179 length = reader.PeekEncodedValue().Length;
180 System.Security.Cryptography.Asn1.SubjectPublicKeyInfoAsn.Decode(ref reader, memoryManager.Memory, out decoded);
181 }
182 catch (AsnContentException inner)
183 {
184 throw new CryptographicException(System.SR.Cryptography_Der_Invalid_Encoding, inner);
185 }
186 oid = new Oid(decoded.Algorithm.Algorithm, null);
187 parameters = new AsnEncodedData(decoded.Algorithm.Parameters?.ToArray() ?? Array.Empty<byte>());
188 keyValue = new AsnEncodedData(decoded.SubjectPublicKey.ToArray());
189 return length;
190 }
191 }
static string Cryptography_Der_Invalid_Encoding
Definition SR.cs:50
Definition SR.cs:7
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.Security.Cryptography.Asn1.SubjectPublicKeyInfoAsn.Decode(), System.length, System.Security.Cryptography.X509Certificates.PublicKey.Oid, System.Security.Cryptography.Asn1.AlgorithmIdentifierAsn.Parameters, System.pointer, System.source, System.Security.Cryptography.Asn1.SubjectPublicKeyInfoAsn.SubjectPublicKey, and System.ReadOnlyMemory< T >.ToArray().

Referenced by System.Security.Cryptography.X509Certificates.PublicKey.PublicKey(), and System.Security.Cryptography.X509Certificates.PublicKey.CreateFromSubjectPublicKeyInfo().