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(); }
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(); }