简体   繁体   English

生成由 Powershell 中的根证书签名的自签名证书

[英]Generate A Self Signed Certificate Signed By An Root Certificate in Powershell

How To Generate A Self Signed Certificate Signed By An Root Certificate using New-SelfSignedCertificate, I Have A Root Certificate I Just Want to Know How To Use -Signer.如何使用 New-SelfSignedCertificate 生成由根证书签名的自签名证书,我有一个根证书我只想知道如何使用 -Signer。

You already figured out that you need to use the -Signer parameter.您已经发现需要使用-Signer参数。 Just ensure that you have the private key for the certificate you want to use to sign the new certificate.只需确保您拥有要用于签署新证书的证书的私钥。 So basically you can only use certificates from the Personal store ("My" in PowerShell).所以基本上你只能使用来自Personal存储的证书(PowerShell 中的“我的”)。

Example:例子:

# find a suitable certificate to use as root
ls Cert:\CurrentUser\My\
$root = ls Cert:\CurrentUser\My\c123a6f16a5f165161a1...  # use the thumbprint of one of your certificates

# create a certificate which is signed with your chosen root certificate
New-SelfSignedCertificate -DnsName test.local -Signer $root -CertStoreLocation Cert:\CurrentUser\My\

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM