使用PowerShell生成自签名证书

  前言

  我们在使用Azure App的时候,经常需要使用到自签名证书。

  正文

  下面的命令,可以帮助我们生成自签名证书:

复制代码
# Create certificate
$mycert = New-SelfSignedCertificate -DnsName "contoso.org" -CertStoreLocation "cert:\CurrentUser\My" -NotAfter (Get-Date).AddYears(1) -KeySpec KeyExchange

# Export certificate to .pfx file
$mycert | Export-PfxCertificate -FilePath mycert.pfx -Password (Get-Credential).password

# Export certificate to .cer file
$mycert | Export-Certificate -FilePath mycert.cer
复制代码

  生成的证书在用户的文件夹下,有两个证书

  • 安全证书:上传到Azure App中
  • Personal Information Exchange:客户端使用

  点击安全证书,可以在属性 - 详细信息里查看指纹,指纹可以用来登录

  经测试,目前指纹只支持Windows系统使用

 

posted @   霖雨  阅读(115)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 本地部署 DeepSeek:小白也能轻松搞定!
· 如何给本地部署的DeepSeek投喂数据,让他更懂你
· 在缓慢中沉淀,在挑战中重生!2024个人总结!
· 从 Windows Forms 到微服务的经验教训
· 李飞飞的50美金比肩DeepSeek把CEO忽悠瘸了,倒霉的却是程序员
历史上的今天:
2013-11-29 SharePoint 2013 对二进制大型对象(BLOB)进行爬网
点击右上角即可分享
微信分享提示