CA 对 SSL CSR 进行 Powershell 脚本签名?
我面临的情况是,我需要将大约 200 个 SSL 证书部署到我们代理机构周围的各种设备(HP iLO - 它们带来的乐趣......)。目前,我有一个 powershell 脚本,可以从 iLO 设备获取 CSR,但我现在需要能够以自动方式使用我们的 CA 对此进行签名,以便我可以传回脚本并导入到设备中。
我们正在使用 Microsoft 证书服务,如果需要,我可以下载 CA 证书、证书链或 CRL。
我并不真正关心如何获得签名证书 - 我的意思是,如果 powershell 需要调用外部应用程序来对其进行签名,那就没问题了。我查看了 .NET SDK 中的 makecert.exe,但它似乎没有完成这项工作。
我感觉使用 OpenSSL 是可能的 - 如果有人能启发我,那就太好了。
干杯
I'm in a situation where I need to deploy around 200 SSL Certificates to various devices around our Agency (HP iLO - such joy they bring...). At present I have a powershell script that obtains a CSR from the iLO Device, but I now need to be able to sign this with our CA in an automated manner so I can pass back to the script and import into the device.
We are using Microsoft Certificate Services and I can download the CA Certificate, Certificate Chain, or CRL if required.
I do not really care how I get the signed certificate - what I mean is, if powershell needs to call an external app to get it signed, then thats fine. I've had a look at makecert.exe in the .NET SDK but it does not appear to do the job.
I have the feeling it may be possible using OpenSSL - If someone could enlighten me, that would be great.
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
今天早上与 Microsoft 工程师打交道后,我们发现使用现有基础架构执行此操作的最优雅的解决方案是使用 certreq.exe。拥有 CSR 后,您可以运行此命令以使用 MS CA 获取证书:
从那里,您可以使用 Get-Content outfile.cer 获取证书以反馈到脚本中。
干杯
Having Dealt with Microsoft Engineer this morning, the most graceful solution in doing this with existing infrastructure is using certreq.exe. Once you have a CSR, you can run this command to obtain a certificate using MS CA:
from there, you ca get the certificate using Get-Content outfile.cer to feed back into the script.
Cheers
本文包含从 IIS 创建 CA 并签署 CSR 的步骤:
使用 OpenSSL 创建自签名证书以与 Microsoft Internet 信息服务 (IIS) 5 一起使用
您可以将 CA 导出为 OpenSSL 可以读取的格式,然后按照“签署证书请求”之后的步骤操作。
This article contains the steps to create a CA and sign a CSR from IIS:
Creating a Self-Signed Certificate using OpenSSL for use with Microsoft Internet Information Services (IIS) 5
You can export the CA into a format OpenSSL can read, and follow the steps after "Sign the Certificate Request".
以下是有关使用 OpenSSL 工具管理 CA 的常见问题解答。
http: //www.gtlib.cc.gatech.edu/pub/linux/docs/HOWTO/other-formats/html_single/SSL-Certificates-HOWTO.html
我已成功使用 OpenSSL 来创建和管理根 CA ,签署 CSR 并生成证书。
Powershell 本身无法处理此问题,但它绝对可以交互并编写整个过程的脚本。
-奥辛
Here's a FAQ for OpenSSL on managing a CA with the tool.
http://www.gtlib.cc.gatech.edu/pub/linux/docs/HOWTO/other-formats/html_single/SSL-Certificates-HOWTO.html
i've used OpenSSL successfully to create and manage a root CA, sign CSRs and generate certificates.
Powershell cannot handle this natively, but it can interact and script the whole process, definitely.
-Oisin