美文网首页
asp.net core 导出开发证书玩法

asp.net core 导出开发证书玩法

作者: 吉凶以情迁 | 来源:发表于2024-05-22 15:52 被阅读0次
dotnet dev-certs https --trust --export-path aa.pem --no-password --format PEM

如下 导出pem格式 公钥和私钥一起生成。

C:\Users\Administrator>dotnet dev-certs https --trust --export-path aa.pem --no-password --format PEM
Trusting the HTTPS development certificate was requested. A confirmation prompt will be displayed if the certificate was not previously trusted. Click yes on the prompt to trust the certificate.
Successfully trusted the existing HTTPS certificate.

C:\Users\Administrator>dotnet dev-certs https --trust --export-path aa.pem --no-password --format PEM

C:\Users\Administrator>dir|findstr aa
2024/05/23  15:34             1,703 aa.key
2024/05/23  15:34             1,118 aa.pem

C:\Users\Administrator>

官方文档中 ,pem为私钥部分


image.png

更多命令如下

dotnet dev-certs https 
  [-c|--check] [--clean] [-ep|--export-path <PATH>]
  [--format] [-i|--import] [-np|--no-password]
  [-p|--password] [-q|--quiet] [-t|--trust]
  [-v|--verbose] [--version]

dotnet dev-certs https -h|--help

生成crt

dotnet dev-certs https -ep ./certificate.crt -p $CREDENTIAL_PLACEHOLDER$ --trust --format PEM

更多参考文档
https://learn.microsoft.com/zh-cn/dotnet/core/tools/dotnet-dev-certs
在 ASP.NET Core 中强制使用 HTTPS | Microsoft Learn
https://learn.microsoft.com/zh-cn/aspnet/core/security/authentication/certauth?view=aspnetcore-8.0

相关文章

网友评论

      本文标题:asp.net core 导出开发证书玩法

      本文链接:https://www.haomeiwen.com/subject/nbyzfjtx.html