The moose likes Security and the fly likes X509 Client Authorization Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » Security
Reply Bookmark "X509 Client Authorization" Watch "X509 Client Authorization" New topic
Author

X509 Client Authorization

Tom Boyce
Greenhorn

Joined: Jul 03, 2003
Posts: 24
I have been struggling with implementing a client authorization with x509 certificates. I am able to get server side, SSL, but adding in the client side seems next to impossible. Does you book cover this aspect? We will be the CA for the client on a Win2k server. Specifically, I believe my issue is between proper key generation (on both sides)and proper deployment. Which is the root cert that needs to be in the server truststore and what other certs make up the chain? This is a very confusing topic and, although I've posted and searched the internet, very few seem willing or able to assist.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11945
Originally posted by Tom Boyce:
Which is the root cert that needs to be in the server truststore and what other certs make up the chain?
When you've generated a self-signed key for the client, export it from the client's keystore, and import it into the server's keystore. This can be done with 'keytool' that's part of the JDK.
If you don't import the client's certificate into the server's keystore, the server won't trust it because none of the "official" CAs have signed your self-signed certificate and the chain of trust is not there.


Author of Test Driven (Manning Publications, 2007) [Blog] [HowToAskQuestionsOnJavaRanch]
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
In the real world case, the root CA is the one that you *MUST* trust. This is one of the assumptions for PKI, otherwise, the whole PKI idea wont work.
So, the 1st interesting question is, how to verify the root CA? The answer is, you have no need to or you cant verify the root CA becos it is already the root, no other CA is above it. Thus, the only way is, the root CA certificate will be signed by itself. Since you always trust the root CA, thus, you trust its signature as well.
Then, for any delicated CAs, you can always verify them by verifying the CA's signature who issue the cert. of the target CA. This forms a certificate path.
For example, if the path is:
root -> CA1 -> CA2 -> CA3 -> server1
If you wanna verify whether server1 is your target server, you check the digital signature from the cert. of server1 with CA3. Then, you check the signature of CA3 with CA2, etc, until you reach the root. As you always trust the root, if you come to the root finally, you then trust the server1.
For another point raised by Lasse, if you have not import the cert of the client, the server is not able to verify the client. However, it depends on your needs.
For example, when you buy a book from Amazon, the focus of you is to identify whether the Amazon website is *true*, and thus, you check its certificate. However, you will discover that Amazon seems never checks your identity. It is becos Amazon dont need to care who you are, it just care whether you paid.
Thus, if your credit card is stolen by others, they can use your card to perform orders. And as this issue become more serious, Visa now required the card holder either register his card for internet used (with limited amount), or need to give a password (or token) before the purchase to perform client anthentication.
Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Marco Pistoia
Author
Greenhorn

Joined: Apr 19, 2004
Posts: 27
You may find help in my book, "Enterprise Java Security", which has a long chapter on JSSE explaining all the details.
Marco Pistoia


Marco Pistoia, Ph.D.<br /><a href="http://www.research.ibm.com/people/p/pistoia/" target="_blank" rel="nofollow">http://www.research.ibm.com/people/p/pistoia/</a>
 
 
subject: X509 Client Authorization
 
Threads others viewed
enabling side menu based on user role in JSP?
X-509 certificates
Digital Certificate using J2ME
Asynchronous Web service call
About SCM tool
developer file tools