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

◆ GetCertContentType() [2/2]

unsafe X509ContentType Internal.Cryptography.Pal.X509Pal.GetCertContentType ( string fileName)
inline

Implements Internal.Cryptography.Pal.IX509Pal.

Definition at line 170 of file X509Pal.cs.

171 {
172 ContentType pdwContentType;
173 fixed (char* pvObject = fileName)
174 {
175 if (!global::Interop.crypt32.CryptQueryObject(CertQueryObjectType.CERT_QUERY_OBJECT_FILE, pvObject, 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))
176 {
177 throw Marshal.GetLastWin32Error().ToCryptographicException();
178 }
179 }
180 return MapContentType(pdwContentType);
181 }
static X509ContentType MapContentType(ContentType contentType)
Definition X509Pal.cs:183
static readonly IntPtr Zero
Definition IntPtr.cs:18

References System.Runtime.InteropServices.Marshal.GetLastWin32Error(), Internal.Cryptography.Pal.X509Pal.MapContentType(), and System.IntPtr.Zero.