public static FromHandle ( |
||
chainContext | ||
return | IChainPal |
public static IChainPal FromHandle(IntPtr chainContext)
{
if (chainContext == IntPtr.Zero)
throw new ArgumentNullException(nameof(chainContext));
SafeX509ChainHandle certChainHandle = Interop.crypt32.CertDuplicateCertificateChain(chainContext);
if (certChainHandle == null || certChainHandle.IsInvalid)
throw new CryptographicException(SR.Cryptography_InvalidContextHandle, nameof(chainContext));
var pal = new ChainPal(certChainHandle);
return pal;
}