how to use using client side certifcates?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Naresh Agarwal

    how to use using client side certifcates?

    Hi

    I'm writing HTTPS client using JDK. I want to perform client side authentication.

    1) How can I enable client side authentication in JDK?
    2) How should I tell JDK about the client side certificate?

    thanks,
    Naresh
  • Chris

    #2
    Re: how to use using client side certifcates?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Naresh Agarwal wrote:
    [color=blue]
    > Hi
    >
    > I'm writing HTTPS client using JDK. I want to perform client side
    > authentication.
    >
    > 1) How can I enable client side authentication in JDK?
    > 2) How should I tell JDK about the client side certificate?
    >
    > thanks,
    > Naresh[/color]

    Hi,
    I assume you're using javax.net.ssl.H ttpsURLConnecti on. Well, what you
    have to do is something like this:

    1. Create a new SSLContext using a factory method.
    2. Call SSLContext.init (), passing in the key and certificate managers
    referring to the authentication data (you might try an X509KeyManager
    and X509TrustManage r).
    3. Call SSLContext.getS ocketFactory() to acquire an SSLSocketFactor y.
    4. Pass this SSLSocketFactor y into
    HttpsURLConnect ion.setSSLSocke tFactory().
    5. Invoke HttpsURLConnect ion.connect() and go from there.

    <<NOTE: Untested!>>

    - --
    Chris
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.2 (GNU/Linux)

    iD8DBQFAGznFnwj A8LryK2IRAt6xAJ 0X2HcQ0UO04SE5M SL3+aAOknsqwwCf S9Ix
    7FRlkeMcy7Rfixb xuQvl1bc=
    =Ptfp
    -----END PGP SIGNATURE-----

    Comment

    Working...