| | |
| | | argList.add("-a"); |
| | | argList.add(sec.getAliasToUse()); |
| | | break; |
| | | case JCEKS: |
| | | argList.add("-k"); |
| | | argList.add("cn=JCEKS,cn=Key Manager Providers,cn=config"); |
| | | argList.add("-t"); |
| | | argList.add("cn=JCEKS,cn=Trust Manager Providers,cn=config"); |
| | | argList.add("-m"); |
| | | argList.add(sec.getKeystorePath()); |
| | | argList.add("-a"); |
| | | argList.add(sec.getAliasToUse()); |
| | | break; |
| | | case PKCS12: |
| | | argList.add("-k"); |
| | | argList.add("cn=PKCS12,cn=Key Manager Providers,cn=config"); |
| | |
| | | { |
| | | cmd.append(s); |
| | | } |
| | | nextPassword = s.equals("-w"); |
| | | nextPassword = "-w".equals(s); |
| | | } |
| | | LOG.log(Level.INFO, "configure DS cmd: "+cmd); |
| | | final InstallerHelper helper = new InstallerHelper(); |
| | |
| | | ReturnCode.CONFIGURATION_ERROR, |
| | | INFO_ERROR_CONFIGURING.get(), null); |
| | | } |
| | | } catch (ApplicationException aex) |
| | | { |
| | | ae = aex; |
| | | } catch (Throwable t) |
| | | { |
| | | ae = new ApplicationException( |
| | |
| | | f = new File(getTemporaryCertificatePath()); |
| | | f.delete(); |
| | | break; |
| | | case JCEKS: |
| | | certManager = new CertificateManager( |
| | | sec.getKeystorePath(), |
| | | CertificateManager.KEY_STORE_TYPE_JCEKS, |
| | | sec.getKeystorePassword()); |
| | | exportCertificate(certManager, sec.getAliasToUse(), |
| | | getTemporaryCertificatePath()); |
| | | |
| | | trustManager = new CertificateManager( |
| | | getTrustManagerPath(), |
| | | CertificateManager.KEY_STORE_TYPE_JCEKS, |
| | | sec.getKeystorePassword()); |
| | | trustManager.addCertificate(sec.getAliasToUse(), |
| | | new File(getTemporaryCertificatePath())); |
| | | createFile(getKeystorePinPath(), sec.getKeystorePassword()); |
| | | f = new File(getTemporaryCertificatePath()); |
| | | f.delete(); |
| | | break; |
| | | case PKCS12: |
| | | certManager = new CertificateManager( |
| | | sec.getKeystorePath(), |
| | |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error configuring certificate: "+t, t); |
| | | throw new ApplicationException( |
| | | ReturnCode.CONFIGURATION_ERROR, |
| | | getThrowableMsg(INFO_ERROR_CONFIGURING_CERTIFICATE.get(), |
| | |
| | | } |
| | | } |
| | | } |
| | | if (thread.getException() != null) |
| | | { |
| | | throw thread.getException(); |
| | | } |
| | | if (canceled) |
| | | { |
| | | checkAbort(); |
| | |
| | | } |
| | | catch (ApplicationException e) |
| | | { |
| | | LOG.log(Level.SEVERE, "Error: "+e, e); |
| | | throw e; |
| | | } |
| | | catch (Throwable t) |