}
File clientCertFile = new File(CoreUtil.getTempDownloadDirectory(getSessionInfo(request)), sel + ".p12");
FileOutputStream out = new FileOutputStream(clientCertFile);
char[] password = ((ShowKeyStoreForm) form).getSelectedKeyStore().getKeyStorePassword().toCharArray();
if (systemClientStore.isKeyEntry(sel)){
PrivateKey keypair = ((ShowKeyStoreForm) form).getSelectedKeyStore().getPrivateKey(sel,
password);
KeyStore userStore = KeyStore.getInstance("PKCS12", "BC");
userStore.load(null, null);
userStore.setKeyEntry(sel, keypair, ((ShowKeyStoreForm) form).getPassword().toCharArray(), ((ShowKeyStoreForm) form).getSelectedKeyStore().getCertificateChain(sel));
userStore.store(out, ((ShowKeyStoreForm) form).getPassword().toCharArray());