Skip to main content
IBM  
Shop Support Downloads
IBM Home Products Consulting Industries News About IBM
IBM developerWorks : Java : Education - Tutorials
Using JSSE for secure socket communication
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
5. Using JSSE sockets
  


Creating keystores page 6 of 11


Next, we need to create some KeyStore objects. We create an empty KeyStore using the static method KeyStore.getInstance(), and initialize it using its load() method, as illustrated below:


    private void setupServerKeystore()
        throws GeneralSecurityException, IOException {
      serverKeyStore = KeyStore.getInstance( "JKS" );
      serverKeyStore.load( new FileInputStream( "server.public" ),
                          passphrase.toCharArray() );
    }

Note that we've created a KeyStore of type "JKS"; this is the standard keystore format used in JCA.


Main menuSection menuFeedbackPreviousNext
Privacy Legal Contact