访问安装认证签名 [英] Access installed certified to sign
问题描述
我正在尝试在Java + JSF项目中签署一个Object。
I am trying to sign an Object in a Java + JSF project.
到目前为止我所做的是创建我自己的X509证书以及一个CA XCA并在Firefox和Chrome上安装它们。
What I have done so far is create my own X509 certificate as well as a CA with XCA and install both of them on Firefox and Chrome.
我一直在搜索3天如何访问它以进行签名(典型的弹出窗口要求选择一个证书,以防你安装了多个)但我找不到有用的东西。我已多次看到此代码行:
I have been searching for 3 days how could I access it to sign (the typical pop-up asking for select a certificate in case you have more than one installed) but I just cannot find something useful. I have seen multiple times this code line:
X509Certificate[] certs = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate");
但我不清楚我在哪里可以获得证书的请求。
but I have no clue about where can I get that request with the certificate.
1)我在哪里可以获得该请求?
1) Where can I get that request?
2)我是否需要SSL连接才能执行此操作?
2) Do I need a SSL connection to be able to do this?
3)只是...如何,我找不到信息所以任何帮助将不胜感激
3) Just... how, I cannot find info so any help will be appreciated
提前致谢
推荐答案
由于安全限制在浏览器上,您无法使用浏览器或系统密钥库进行数字签名。既不是javascript,也不是java,也不是插件。
Due to security restrictions on browsers you can not digitally sign using the browser or system key store. Neither with javascript, nor with java nor with a plugin.
参见如何使用智能卡在Web应用程序(JavaScript)中制作数字签名?
1)我在哪里可以获得该请求?
1) Where can I get that request?
X509Certificate[] certs = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate");
此代码用于其他内容。它允许以SSL标识获取用户证书
This code is for something else. It allows to obtain the certificate of the user in an SSL identification
2)我是否需要SSL连接才能执行此操作?
2) Do I need a SSL connection to be able to do this?
它不相关
3 )只是...如何,我找不到信息所以任何帮助将不胜感激
3) Just... how, I cannot find info so any help will be appreciated
替代方案:
-
使用WebCryptographyApi加载证书。请参阅如何加载PKCS#12数字证书使用Javascript WebCrypto API
使用chrome messaging api(爱沙尼亚)。请参阅 https://stackoverflow.com/a/29806091/6371459
Use chrome messaging api (Estonia). See https://stackoverflow.com/a/29806091/6371459
使用通过javascript连接的本地应用程序(西班牙)请参阅 https://stackoverflow.com/a/38658414/6371459
Use a local application connected through javascript (Spain) See https://stackoverflow.com/a/38658414/6371459
这篇关于访问安装认证签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!