如何在 Windows XP 上获得 x.509 证书
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4657459/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get a x.509 certificate on windows XP
提问by Arthur
In order to connect to a web service, I need a X.509 certificate.
为了连接到 Web 服务,我需要一个 X.509 证书。
With this certificate I then need to send a public key to the customer support of this web service.
使用此证书,我需要将公钥发送给此 Web 服务的客户支持。
I am really clueless on how to generate this certificate. I had a look at a few website explaining what is X.509, but I did not find something helpful.
我对如何生成这个证书真的一无所知。我查看了一些解释什么是 X.509 的网站,但我没有找到有用的东西。
Basically I would like to know:
基本上我想知道:
- How can I generate a certificate ?
- How to get a public key from that certificate ?
- 如何生成证书?
- 如何从该证书获取公钥?
采纳答案by Jon
Take a look at the answer to this question. It involves using the makecert
tool, which is available on Windows systems.
看看这个问题的答案。它涉及使用该makecert
工具,该工具可在 Windows 系统上使用。
For more information on what makecert can do and how to do it, see this guideand the makecert documentation.
有关 makecert 可以做什么以及如何执行的更多信息,请参阅本指南和makecert 文档。
回答by JasonStoltz
Hmmm, I think the short answer is that you can do it with something like OpenSSL. More info here. I think there is also some other answerson SO that might help.
嗯,我认为简短的回答是您可以使用OpenSSL 之类的东西来做到这一点。更多信息在这里。我认为还有其他一些关于 SO 的答案可能会有所帮助。
Try a command like this:
试试这样的命令:
openssl req -x509 -newkey rsa:1024 -keyout your_private_key.pem -out your_cert.pem -nodes -config openssl.cfg -subj <Not sure what you'd put here> -days 365
That should generate your_private_key.pem, your private key, and your_cert, your certificate. You'd need to do some research as to what to enter for "subj", I know it needs to be in a specific format. I think you can just send customer support that certificate and they can retrieve the public key, or rather, maybe that certificate IS the public key. I'm not exactly an expert on this, but this should put you on the right track.
这应该生成 your_private_key.pem,您的私钥和 your_cert,您的证书。您需要对“subj”的输入内容进行一些研究,我知道它需要采用特定格式。我认为您可以向客户支持发送该证书,他们可以检索公钥,或者更确切地说,该证书可能是公钥。我不是这方面的专家,但这应该让你走上正轨。
EDIT: Either run that command in the \bin directory of wherever you install OpenSSL, or change the value of "-config" to point to the right location of "openssl.cf", which is under \bin.
编辑:要么在安装 OpenSSL 的任何位置的 \bin 目录中运行该命令,要么将“-config”的值更改为指向 \bin 下的“openssl.cf”的正确位置。