/** * Gets the initialized key managers. * * @throws GeneralSecurityException * @throws IOException */ protected KeyManager[] getKeyManagers() throws GeneralSecurityException, IOException { KeyStore ks = this.getKeystore(); String alias = this.config.getSslKeyAlias(); KeyManagerFactory kmf = KeyManagerFactory.getInstance(this.config.getSslCertificateEncodingAlgorithm()); kmf.init(ks, this.config.getSslKeyStorePassword().toCharArray()); KeyManager[] kms = kmf.getKeyManagers(); if (alias != null) { if ("JKS".equals(this.config.getSslKeyStoreType())) { alias = alias.toLowerCase(); } for (int i = 0; i < kms.length; i++) { kms[i] = new JSSEKeyManager((X509KeyManager) kms[i], alias); } } return kms; }
/** * Gets the initialized key managers. * * @throws GeneralSecurityException * @throws IOException */ protected KeyManager[] getKeyManagers() throws GeneralSecurityException, IOException { KeyStore ks = this.getKeystore(); String alias = this.config.getSslKeyAlias(); KeyManagerFactory kmf = KeyManagerFactory.getInstance(this.config.getSslCertificateEncodingAlgorithm()); kmf.init(ks, this.config.getSslKeyStorePassword().toCharArray()); KeyManager[] kms = kmf.getKeyManagers(); if (alias != null) { if ("JKS".equals(this.config.getSslKeyStoreType())) { alias = alias.toLowerCase(); } for (int i = 0; i < kms.length; i++) { kms[i] = new JSSEKeyManager((X509KeyManager) kms[i], alias); } } return kms; }
/** * Gets the initialized key managers. * @throws GeneralSecurityException * @throws IOException */ protected KeyManager[] getKeyManagers() throws GeneralSecurityException, IOException { KeyStore ks = this.getKeystore(); String alias = this.config.getSslKeyAlias(); KeyManagerFactory kmf = KeyManagerFactory.getInstance(this.config.getSslCertificateEncodingAlgorithm()); kmf.init(ks, this.config.getSslKeyStorePassword().toCharArray()); KeyManager[] kms = kmf.getKeyManagers(); if (alias != null) { if ("JKS".equals(this.config.getSslKeyStoreType())) { alias = alias.toLowerCase(); } for (int i = 0; i < kms.length; i++) { kms[i] = new JSSEKeyManager((X509KeyManager) kms[i], alias); } } return kms; }
/** * Gets the SSL server's keystore. */ private KeyStore getKeystore() throws IOException, KeyStoreException, NoSuchProviderException, NoSuchAlgorithmException, CertificateException { return this.getStore(this.config.getSslKeyStoreType(), this.config.getSslKeyStoreProvider(), this.config.getSslKeyStore(), this.config.getSslKeyStorePassword()); }
private KeyStore getKeystore() throws IOException, KeyStoreException, NoSuchProviderException, NoSuchAlgorithmException, CertificateException { return this.getStore(this.config.getSslKeyStoreType(), this.config.getSslKeyStoreProvider(), this.config.getSslKeyStore(), this.config.getSslKeyStorePassword()); }
/** * Gets the SSL server's keystore. */ private KeyStore getKeystore() throws IOException, KeyStoreException, NoSuchProviderException, NoSuchAlgorithmException, CertificateException { return this.getStore(this.config.getSslKeyStoreType(), this.config.getSslKeyStoreProvider(), this.config.getSslKeyStore(), this.config.getSslKeyStorePassword()); }
/** * Gets the SSL server's truststore. */ protected KeyStore getTrustStore() throws IOException, KeyStoreException, NoSuchProviderException, NoSuchAlgorithmException, CertificateException { String trustStore = this.config.getSslTrustStore(); if (trustStore == null) return null; String truststorePassword = this.config.getSslTrustStorePassword(); if (truststorePassword == null) { truststorePassword = this.config.getSslKeyStorePassword(); } else if (truststorePassword.equals("")) { truststorePassword = null; } String truststoreType = this.config.getSslTrustStoreType(); if (truststoreType == null) { truststoreType = this.config.getSslKeyStoreType(); } String truststoreProvider = this.config.getSslTrustStoreProvider(); if (truststoreProvider == null) { truststoreProvider = this.config.getSslKeyStoreProvider(); } return this.getStore(truststoreType, truststoreProvider, trustStore, truststorePassword); }
protected KeyStore getTrustStore() throws IOException, KeyStoreException, NoSuchProviderException, NoSuchAlgorithmException, CertificateException { String trustStore = this.config.getSslTrustStore(); if (trustStore == null) return null; String truststorePassword = this.config.getSslTrustStorePassword(); if (truststorePassword == null) { truststorePassword = this.config.getSslKeyStorePassword(); } else if (truststorePassword.equals("")) { truststorePassword = null; } String truststoreType = this.config.getSslTrustStoreType(); if (truststoreType == null) { truststoreType = this.config.getSslKeyStoreType(); } String truststoreProvider = this.config.getSslTrustStoreProvider(); if (truststoreProvider == null) { truststoreProvider = this.config.getSslKeyStoreProvider(); } return this.getStore(truststoreType, truststoreProvider, trustStore, truststorePassword); }
/** * Gets the SSL server's truststore. */ protected KeyStore getTrustStore() throws IOException, KeyStoreException, NoSuchProviderException, NoSuchAlgorithmException, CertificateException { String trustStore = this.config.getSslTrustStore(); if (trustStore == null) return null; String truststorePassword = this.config.getSslTrustStorePassword(); if (truststorePassword == null) { truststorePassword = this.config.getSslKeyStorePassword(); } else if (truststorePassword.equals("")) { truststorePassword = null; } String truststoreType = this.config.getSslTrustStoreType(); if (truststoreType == null) { truststoreType = this.config.getSslKeyStoreType(); } String truststoreProvider = this.config.getSslTrustStoreProvider(); if (truststoreProvider == null) { truststoreProvider = this.config.getSslKeyStoreProvider(); } return this.getStore(truststoreType, truststoreProvider, trustStore, truststorePassword); }