从powershell中的目录获取ssl证书指纹
我有一个应用程序正在引发异常,因为我的计算机上没有安装ssl证书。我知道丢失证书的tumbprint,但我不知道如何按名称查找它 我已经这样做了:从powershell中的目录获取ssl证书指纹,powershell,ssl,Powershell,Ssl,我有一个应用程序正在引发异常,因为我的计算机上没有安装ssl证书。我知道丢失证书的tumbprint,但我不知道如何按名称查找它 我已经这样做了: Get-ChildItem -Path Cert:\LocalMachine\My 并验证我需要的证书未安装。我的源代码目录(c:\source\project\certs)中有证书,但我需要知道要安装目录中的哪个证书 有没有办法像上面一行那样,从“c:\source\project\certs”文件夹而不是证书存储区列出证书?这应该可以做到: $
Get-ChildItem -Path Cert:\LocalMachine\My
并验证我需要的证书未安装。我的源代码目录(c:\source\project\certs)中有证书,但我需要知道要安装目录中的哪个证书
有没有办法像上面一行那样,从“c:\source\project\certs”文件夹而不是证书存储区列出证书?这应该可以做到:
$password= ConvertTo-SecureString -String "Pass" -AsPlainText -Force
Get-ChildItem -Path "C:\source\project\certs" -Filter *.pfx | % {
$certobject = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$certobject.import($_.FullName, $password, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::DefaultKeySet)
$certobject.Thumbprint
}
@PeterSchneider不,它不会将它们导入证书存储,只是导入到对象中