ssl - 将用户证书导入 windows 10 可信根证书

标签 ssl windows-10 vagrant certificate homestead

我定期从 Vagrant Ubuntu 服务器生成 CRT 证书,并使用 Windows 10 管理证书工具 mmc.exe. 导入它们,目前我正在导入他们一个一个地发送给 Trusted Root Certification Authorities 我想知道有没有办法:

  • 将一堆 crt 文件导入到 Trusted Root Certification Authorities
  • 动态执行上述过程

谢谢你的建议,

最佳答案

我使用 PowerShell 将 CA 证书导入计算机/机器商店的 Trusted Root Certification Authorities

function Add-TrustedRootMachineCertificate($certificate){
  $store = get-item Cert:\LocalMachine\Root;
  $store.Open("MaxAllowed")
  if($store.Certificates.Find(
    "FindByThumbprint", 
     $certificate.Thumbprint, $false).Count -eq 0
  ){
    Write-Host "Add root certificate...";
    $certificate
    $store.Add($certificate);
  }
  $store.Close();
}

$currentDir = Split-Path $MyInvocation.MyCommand.Path -Parent;

foreach($file in Get-ChildItem "$($currentDir)\Root" -Filter "*.cer"){
  $cert = 
    New-Object System.Security.Cryptography.X509Certificates.X509Certificate2(
      $file.FullName);
  Add-TrustedRootMachineCertificate -certificate $cert;
}

关于ssl - 将用户证书导入 windows 10 可信根证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57131236/

相关文章:

vagrant - 尝试 vagrant up 时出错

Vagrant - 不支持该功能 'change_host_name'

amazon-web-services - 安装 vagrant aws 插件

http - 启用 LDAP over SSL 和 HTTP over SSL 是否需要两个证书?

java - 带 SSL 的简单 RMI 服务器

c# - FromBluetoothAddressAsync 永远不会在 WPF 应用程序中的 Windows 10 Creators Update 上返回

windows-10 - 为什么 make.exe 尝试在 Windows 上运行/usr/bin/sh?

c# - 框架中的 WPF 页面导航,如何从我导航到的页面访问我的原始框架?

.net - 通过安全连接(SSL、https)登录网站的简便方法?

.net - 关于第 3 方集成商的 wcf 服务的问题