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

◆ GetChainEngine()

static SafeChainEngineHandle Internal.Cryptography.Pal.ChainPal.GetChainEngine ( X509ChainTrustMode trustMode,
X509Certificate2Collection customTrustStore,
bool useMachineContext )
inlinestaticprivate

Definition at line 127 of file ChainPal.cs.

128 {
129 if (trustMode == X509ChainTrustMode.CustomRootTrust)
130 {
131 using (SafeCertStoreHandle safeCertStoreHandle = ConvertStoreToSafeHandle(customTrustStore, returnEmptyHandle: true))
132 {
134 config.cbSize = Marshal.SizeOf<CERT_CHAIN_ENGINE_CONFIG>();
135 config.hExclusiveRoot = safeCertStoreHandle.DangerousGetHandle();
136 return global::Interop.crypt32.CertCreateCertificateChainEngine(ref config);
137 }
138 }
139 return useMachineContext ? SafeChainEngineHandle.MachineChainEngine : SafeChainEngineHandle.UserChainEngine;
140 }
static SafeCertStoreHandle ConvertStoreToSafeHandle(X509Certificate2Collection extraStore, bool returnEmptyHandle=false)
Definition ChainPal.cs:142
static int SizeOf(object structure)
Definition Marshal.cs:697

References Internal.Cryptography.Pal.ChainPal.ConvertStoreToSafeHandle(), System.Runtime.InteropServices.Marshal.SizeOf(), and Internal.Cryptography.Pal.Native.SafeChainEngineHandle.UserChainEngine.

Referenced by Internal.Cryptography.Pal.ChainPal.BuildChain().