Set read permission for certificate from command line

后端 未结 1 1859
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-14 02:42

Can anyone point me in the right direction for managing read permissions for certificates from the command line? I\'m scripting our certificate installation, and need to all

1条回答
  •  臣服心动
    2021-01-14 03:08

    I've done that to grant a our web application access to a private key of a cert that was installed in windows.

    Here's a powershell script. It relies on FindPrivateKey.exe from Microsoft.

    # Use FindPrivateKey.exe (From Windows SDK) to get the file name of the private key.
    $s = cmd /c "FindPrivateKey.exe My LocalMachine -t   `"9D1F685D554E5B04C591D7967FB0D151153A25D8`" -a"
    
    # Grant read access on the private key
    cmd /c "cacls.exe `"$s`" /E /G `"IIS_IUSRS`":R"
    

    0 讨论(0)
提交回复
热议问题