instance = new SecureAdminClientManager(commandMasterPassword, isInteractive, serverName, nodeDir, node, nodeDirRoot);
/** * Returns KeyManagers which access the SSL key store for use in * performing client cert authentication. The returned KeyManagers will * most likely be passed to {@link SSLContext.init }. * @return KeyManagers */ public static KeyManager[] getKeyManagers() { return (instance == null ? null : instance.keyManagers()); }
private KeyManager[] prepareKeyManagers(final char[] commandMasterPassword, final boolean isPromptable) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException, UnrecoverableKeyException { /* * The configuration specifies what alias we should use for SSL client * authentication. Because the keystore on disk contains multiple certs, * extract the required cert from the on-disk keystore and add it to a * temporary key store so it's the only cert there. */ Certificate instanceCert = getCertForConfiguredAlias( commandMasterPassword, isPromptable); final KeyStore ks = instanceCertOnlyKS(instanceCert); /* * The caller will eventually need an array of KeyManagers to pass to * SSLContext.initClientAuthentication. Create that array now from the internal, single-cert * keystore so it's available later. */ final KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); kmf.init(ks, new char[] {}); return kmf.getKeyManagers(); }
final String node, final File nodeDirRoot) { domain = prepareDomain(serverName, nodeDir, node, nodeDirRoot); if (domain == null) { return; keyManagers = prepareKeyManagers(commandMasterPassword, isInteractive); } catch (Exception ex) { throw new RuntimeException(ex);
private KeyManager[] prepareKeyManagers(final char[] commandMasterPassword, final boolean isPromptable) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException, UnrecoverableKeyException { /* * The configuration specifies what alias we should use for SSL client * authentication. Because the keystore on disk contains multiple certs, * extract the required cert from the on-disk keystore and add it to a * temporary key store so it's the only cert there. */ Certificate instanceCert = getCertForConfiguredAlias( commandMasterPassword, isPromptable); final KeyStore ks = instanceCertOnlyKS(instanceCert); /* * The caller will eventually need an array of KeyManagers to pass to * SSLContext.initClientAuthentication. Create that array now from the internal, single-cert * keystore so it's available later. */ final KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); kmf.init(ks, new char[] {}); return kmf.getKeyManagers(); }
final String node, final File nodeDirRoot) { domain = prepareDomain(serverName, nodeDir, node, nodeDirRoot); if (domain == null) { return; keyManagers = prepareKeyManagers(commandMasterPassword, isInteractive); } catch (Exception ex) { throw new RuntimeException(ex);
/** * Returns KeyManagers which access the SSL key store for use in * performing client cert authentication. The returned KeyManagers will * most likely be passed to {@link SSLContext.init }. * @return KeyManagers */ public static KeyManager[] getKeyManagers() { return (instance == null ? null : instance.keyManagers()); }
instance = new SecureAdminClientManager(commandMasterPassword, isInteractive, serverName, nodeDir, node, nodeDirRoot);