生成证书

使用如下的powershell脚本

$cert = New-SelfSignedCertificate -DnsName @("*.chuck.net", "Chuck-Net") -CertStoreLocation "cert:\LocalMachine\My"
$password = ConvertTo-SecureString '123' -AsPlainText -Force
$certKeyPath = "C:\workspace\Software\chuck.net.pfx"
$cert | Export-PfxCertificate -FilePath $certKeyPath -Password $password
#$rootCert = $(Import-PfxCertificate -FilePath $certKeyPath -CertStoreLocation 'Cert:\LocalMachine\Root' -Password $password)

原文地址:https://www.cnblogs.com/chucklu/p/15239271.html