簡體   English   中英

自簽名證書流程

[英]Self signed certificate process

證書自簽名過程如何工作? 從請求自簽名證書開始,go 給誰以及誰執行簽名? (端到端流程)

您自己完成所有自簽名證書的事情。

這是我過去使用的 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-文件-證書/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM