证书自签名过程是如何工作的?从请求自签名证书开始,它将发送给谁,由谁执行签名?(端到端流程)
发布于 2021-12-02 19:08:08
所有的自签名证书都是你自己做的。
下面是我过去使用过的PowerShell脚本。当然,将值更新为对您有意义的值。
$myName = "Your Name"
$myEmail = "your@emaildomain.tld"
$certPassword = "password1234"
$cert = New-SelfSignedCertificate -Type Custom -certstorelocation cert:\localmachine\my -Container test* -Subject "CN=$myName" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.2","2.5.29.17={text}upn=$myEmail") -KeyUsage DigitalSignature -KeyAlgorithm RSA -KeyLength 2048 -NotAfter (Get-Date).AddMonths(6)
$pwd = ConvertTo-SecureString -String "$certPassword" -Force -AsPlainText
$path = "cert:\localMachine\my\" + $cert.thumbprint
Export-PfxCertificate -cert $path -FilePath c:\temp\pdf\pdf.pfx -Password $pwd我已经使用该脚本生成的自签名证书对PDF文件进行了签名。要查看我如何使用此脚本的示例和上下文,您可以查看这篇博客文章:https://www.leadtools.com/blog/document-imaging/pdf/csharp-java-code-digitally-sign-pdf-files-certificate/
https://stackoverflow.com/questions/70204871
复制相似问题