Code example for KeyStore

Methods: load

0
	  
	  CAStore = KeyStore.getInstance( "JKS" );
	   
	  InputStream ims = asmgr.open("truststore.bks");
	  	//keyStore.load(new FileInputStream("Bob.bks"), passwd.toCharArray());  
	  CAStore.load( ims,
                      "catrust".toCharArray() );
 
  } 
 
 
 private void setupSSLContext() throws GeneralSecurityException, IOException { 
    TrustManagerFactory tmf = TrustManagerFactory.getInstance( "SunX509" );
    tmf.init( CAStore );
 
    KeyManagerFactory kmf = KeyManagerFactory.getInstance( "SunX509" );
    kmf.init(AliceKeyStore,"psalice".toCharArray());
    sslContext = SSLContext.getInstance( "TLS" );
    sslContext.init( kmf.getKeyManagers(),
                     tmf.getTrustManagers(),
                     secureRandom );