【问题标题】:Self signed certificate process自签名证书流程
【发布时间】:2022-01-09 06:20:50
【问题描述】:

证书自签名过程如何工作?从请求自签名证书开始,它会交给谁以及由谁执行签名? (端到端流程)

【问题讨论】:

    标签: cryptography certificate ssl-certificate x509certificate self-signed-certificate


    【解决方案1】:

    您自己完成所有自签名证书的事情。

    这是我过去使用的 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/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-10-08
      • 1970-01-01
      • 2020-08-25
      • 1970-01-01
      • 2020-08-04
      • 1970-01-01
      • 2012-11-01
      相关资源
      最近更新 更多