admin管理员组文章数量:1327750
For an administration interface we want to implement client authentication with SSL. The idea is that during the registration process every user generates a SSL certificate, which is registered in the browser and used for authenticating the client to the server. It is important that the private key never leaves the client. Hence it is no solution to generate the certificate on the server and send it to the client.
Is it possible to generate a SSL cert in the browser (e.g. IE 9+, Firefox 12+, Chrome) using JavaScript? Is it possible to register a certificate?
For an administration interface we want to implement client authentication with SSL. The idea is that during the registration process every user generates a SSL certificate, which is registered in the browser and used for authenticating the client to the server. It is important that the private key never leaves the client. Hence it is no solution to generate the certificate on the server and send it to the client.
Is it possible to generate a SSL cert in the browser (e.g. IE 9+, Firefox 12+, Chrome) using JavaScript? Is it possible to register a certificate?
Share Improve this question asked May 22, 2012 at 10:51 gregorgregor 4,8333 gold badges29 silver badges43 bronze badges 4- 1 I'm pretty sure that you can generate a SSL certificate, but I doubt that you'll be able to register it. – Joachim Sauer Commented May 22, 2012 at 10:54
- I've seen it done before with financial websites. But it was more install an ActiveX or run an application an it would generate the request, the certificate and install it in the personal certificate store. It also was able to prevent it from exporting between puters or profiles. How, I'm unsure. – inevio Commented May 22, 2012 at 10:55
- Are you trying to generate it on the fly during sign-up? I don't think you can unless the user has something like OpenSSL installed. – Marcus_33 Commented May 22, 2012 at 18:34
- On feasibility, there definitely are websites that generate client certificates via browser, but one implementation I've seen was in VBScript (oh god) and obviously only worked in IE. – user6269864 Commented Jan 21, 2019 at 7:46
1 Answer
Reset to default 7You can't really generate a certificate in the browser, but you can generate a certificate request (or equivalent) in the browser: the key-pair is generated within the browser and the private key never leaves it.
(Note that if you generated a certificate directly within the browser, it would at best be self-signed, since the CA wouldn't give you its private key. That's why you only get to have a certificate-request, since there's little demand for generating self-signed certificates. I think there's a Firefox extension that could do it, though.)
The certificate request is sent to the server, but the format depends on the browser and the method used. What you'll get on the server side is the public key, it's up to the service you implement to turn it into a certificate (unless you use an existing service of course). You can find more details about this in this answer.
Once the certificate is generated on the server, it can be re-imported back to be associated with the private key.
本文标签: javascriptIs it possible to generate a SSL certificate in the browserStack Overflow
版权声明:本文标题:javascript - Is it possible to generate a SSL certificate in the browser? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742229358a2436930.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论