Change default alias, mykey in HTTPS using JSSE

Discussion in 'Java' started by amitgupta_india@softhome.net, Jun 14, 2005.

  1. Guest

    Hello everybody:

    I am writing a client that talks to a server using HTTPS.

    We are presently in development stage, so I have access to server's
    trust store.

    I created a new keypair using keytool without specifying any alias.
    So, the default alias was used - mykey

    I exported the certificate into a file and imported this into the
    server's trust store.

    Next, in my java client, I specified the location of my keystore and
    identity store as follows
    ////////////////////////////////////////////////////////
    String identityStore = "E:"+ File.separator +"Weblogic8.1"+
    File.separator +"weblogic81"+ File.separator +"server"+ File.separator
    +"lib"+ File.separator +"id.keystore";

    String trustStore = "E:"+ File.separator +"Weblogic8.1"+ File.separator
    +"weblogic81"+ File.separator +"server"+ File.separator +"lib"+
    File.separator +"trust.keystore";

    System.setProperty("javax.net.ssl.keyStore", identityStore);
    System.setProperty("javax.net.ssl.trustStore", trustStore);
    System.setProperty("javax.net.ssl.keyStorePassword", "rocket");
    System.setProperty("javax.net.ssl.trustStorePassword", "socket");
    ////////////////////////////////////////////////////////

    Everything works fine. But I want to now use a different alias, as
    assuming that the certificate during the production stage would also
    have mykey as alias is naive.

    I am not able to figure out where to specify the name of the alias.

    Any help or pointers would be greatly appreciated

    Thanks

    Amit
     
    , Jun 14, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Y3JhaWd3aHVudA==?=

    'Error reading key file 'MyKey.snk'...

    =?Utf-8?B?Y3JhaWd3aHVudA==?=, Nov 21, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    5,062
    =?Utf-8?B?Y3JhaWd3aHVudA==?=
    Nov 21, 2005
  2. al butler
    Replies:
    0
    Views:
    607
    al butler
    Jul 4, 2003
  3. John Salvo
    Replies:
    0
    Views:
    5,809
    John Salvo
    Sep 1, 2003
  4. Keith G
    Replies:
    0
    Views:
    1,666
    Keith G
    Sep 8, 2003
  5. Christine Mayer

    myMap.get(myKey) with JSTL?

    Christine Mayer, Oct 16, 2007, in forum: Java
    Replies:
    7
    Views:
    2,091
    Daniel Pitts
    Oct 17, 2007
Loading...

Share This Page