Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
480 views
in Technique[技术] by (71.8m points)

java - Access installed certified to sign

I am trying to sign an Object in a Java + JSF project.

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.

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) Where can I get that request?

2) Do I need a SSL connection to be able to do this?

3) Just... how, I cannot find info so any help will be appreciated

Thanks in advance

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

See How to make a digital signature in a web application (JavaScript) using a smartcard?

1) Where can I get that request?

X509Certificate[] certs = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate");

This code is for something else. It allows to obtain the certificate of the user in an SSL identification

2) Do I need a SSL connection to be able to do this?

It is not related

3) Just... how, I cannot find info so any help will be appreciated

Alternatives:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...