使用如下的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)