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

◆ GetCertContentType() [1/2]

unsafe X509ContentType Internal.Cryptography.Pal.X509Pal.GetCertContentType ( ReadOnlySpan< byte > rawData)
inline

Implements Internal.Cryptography.Pal.IX509Pal.

Definition at line 156 of file X509Pal.cs.

157 {
158 ContentType pdwContentType;
159 fixed (byte* pbData = rawData)
160 {
161 CRYPTOAPI_BLOB cRYPTOAPI_BLOB = new CRYPTOAPI_BLOB(rawData.Length, pbData);
162 if (!global::Interop.crypt32.CryptQueryObject(CertQueryObjectType.CERT_QUERY_OBJECT_BLOB, &cRYPTOAPI_BLOB, ExpectedContentTypeFlags.CERT_QUERY_CONTENT_FLAG_ALL, ExpectedFormatTypeFlags.CERT_QUERY_FORMAT_FLAG_ALL, 0, IntPtr.Zero, out pdwContentType, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero))
163 {
164 throw Marshal.GetLastWin32Error().ToCryptographicException();
165 }
166 }
167 return MapContentType(pdwContentType);
168 }
static X509ContentType MapContentType(ContentType contentType)
Definition X509Pal.cs:183
static readonly IntPtr Zero
Definition IntPtr.cs:18

References System.Runtime.InteropServices.Marshal.GetLastWin32Error(), System.ReadOnlySpan< T >.Length, Internal.Cryptography.Pal.X509Pal.MapContentType(), and System.IntPtr.Zero.