Programmatically install Certificate Revocation List (CRL)

前端 未结 4 950
天涯浪人
天涯浪人 2021-02-06 09:09

I need to download and install about 50 CRLs once a week and install them on several Windows servers. Downloading is the easy part, is there a way I could script the CRL import

4条回答
  •  迷失自我
    2021-02-06 09:56

    I don't know a way to do it via script. Can you write C code? If I understand what you want to do, you will use the CryptUiWizImport function, and the CRYPTUI_WIZ_IMPORT_SRC_INFO structure.

    Here's a sample of code that installs a Cert; the corresponding CRL import is similar.

    Addendum:
    This post points out that Win32 APIs (such as CryptUiWizImport) are not directly accessible from PowerShell, and then describes a possible workaround: from within the PowerShell script, dynamically generate and compile C# code that does the P/Invoke stuff, and then run the resulting assembly. This would allow you to do the CryptUiWizImport strictly from a powershell script, although it would be a pretty exotic one.

提交回复
热议问题