public static org.opcfoundation.ua.transport.security.KeyPair loadKeyPairFromProtectedStore(String storeLocation,String alias,String storePW,String privatePW) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException {
  KeyStore store=null;
  store=KeyStore.getInstance("JKS");
  File keystoreFile=new File(storeLocation);
  FileInputStream in=new FileInputStream(keystoreFile);
  store.load(in,storePW.toCharArray());
  in.close();
  X509Certificate cert=(X509Certificate)store.getCertificate(alias);
  RSAPrivateKey key=(RSAPrivateKey)store.getKey(alias,privatePW.toCharArray());
  return new org.opcfoundation.ua.transport.security.KeyPair(new Cert(cert),new PrivKey(key));
}

public static org . opcfoundation . ua . transport . security . KeyPair loadKeyPairFromProtectedStore ( String storeLocation , String alias , String storePW , String privatePW ) throws KeyStoreException , IOException , NoSuchAlgorithmException , CertificateException , UnrecoverableKeyException { KeyStore store = null ; store = KeyStore . getInstance ( "JKS" ) ; File keystoreFile = new File ( storeLocation ) ; FileInputStream in = new FileInputStream ( keystoreFile ) ; store . load ( in , storePW . toCharArray ( ) ) ; in . close ( ) ; X509Certificate cert = ( X509Certificate ) store . getCertificate ( alias ) ; RSAPrivateKey key = ( RSAPrivateKey ) store . getKey ( alias , privatePW . toCharArray ( ) ) ; return new org . opcfoundation . ua . transport . security . KeyPair ( new Cert ( cert ) , new PrivKey ( key ) ) ; }
load a keypair from a java key store .
