/** * Loads keystore using an input stream or a file path in the same * order of precedence. * * Required for integrations to be able to override the mechanism * used to load a keystore in order to provide their own implementation. * * @param storePath path of keystore file * @param storeType keystore type * @param storeProvider keystore provider * @param storePassword keystore password * @return created keystore * @throws Exception if unable to get keystore */ protected KeyStore getKeyStore(String storePath, String storeType, String storeProvider, String storePassword) throws Exception { return CertificateUtils.getKeyStore(Resource.newResource(storePath), storeType, storeProvider, storePassword); }
/** * Override this method to provide alternate way to load a keystore. * * @param resource the resource to load the keystore from * @return the key store instance * @throws Exception if the keystore cannot be loaded */ protected KeyStore loadKeyStore(Resource resource) throws Exception { String storePassword = Objects.toString(_keyStorePassword, null); return CertificateUtils.getKeyStore(resource, getKeyStoreType(), getKeyStoreProvider(), storePassword); }
/** * Override this method to provide alternate way to load a truststore. * * @param resource the resource to load the truststore from * @return the key store instance * @throws Exception if the truststore cannot be loaded */ protected KeyStore loadTrustStore(Resource resource) throws Exception { String type = Objects.toString(getTrustStoreType(), getKeyStoreType()); String provider = Objects.toString(getTrustStoreProvider(), getKeyStoreProvider()); Password passwd = _trustStorePassword; if (resource == null || resource.equals(_keyStoreResource)) { resource = _keyStoreResource; if (passwd == null) passwd = _keyStorePassword; } return CertificateUtils.getKeyStore(resource, type, provider, Objects.toString(passwd, null)); }
/** * Loads keystore using an input stream or a file path in the same * order of precedence. * * Required for integrations to be able to override the mechanism * used to load a keystore in order to provide their own implementation. * * @param storeStream keystore input stream * @param storePath path of keystore file * @param storeType keystore type * @param storeProvider keystore provider * @param storePassword keystore password * @return created keystore * @throws Exception */ protected KeyStore getKeyStore(InputStream storeStream, String storePath, String storeType, String storeProvider, String storePassword) throws Exception { return CertificateUtils.getKeyStore(storeStream, storePath, storeType, storeProvider, storePassword); }
/** * Loads keystore using an input stream or a file path in the same * order of precedence. * * Required for integrations to be able to override the mechanism * used to load a keystore in order to provide their own implementation. * * @param storeStream keystore input stream * @param storePath path of keystore file * @param storeType keystore type * @param storeProvider keystore provider * @param storePassword keystore password * @return created keystore * @throws Exception */ protected KeyStore getKeyStore(InputStream storeStream, String storePath, String storeType, String storeProvider, String storePassword) throws Exception { return CertificateUtils.getKeyStore(storeStream, storePath, storeType, storeProvider, storePassword); }
/** * Loads keystore using an input stream or a file path in the same * order of precedence. * * Required for integrations to be able to override the mechanism * used to load a keystore in order to provide their own implementation. * * @param storeStream keystore input stream * @param storePath path of keystore file * @param storeType keystore type * @param storeProvider keystore provider * @param storePassword keystore password * @return created keystore * @throws Exception */ protected KeyStore getKeyStore(InputStream storeStream, String storePath, String storeType, String storeProvider, String storePassword) throws Exception { return CertificateUtils.getKeyStore(storeStream, storePath, storeType, storeProvider, storePassword); }
/** * Loads keystore using an input stream or a file path in the same * order of precedence. * * Required for integrations to be able to override the mechanism * used to load a keystore in order to provide their own implementation. * * @param storeStream keystore input stream * @param storePath path of keystore file * @param storeType keystore type * @param storeProvider keystore provider * @param storePassword keystore password * @return created keystore * @throws Exception */ protected KeyStore getKeyStore(InputStream storeStream, String storePath, String storeType, String storeProvider, String storePassword) throws Exception { return CertificateUtils.getKeyStore(storeStream, storePath, storeType, storeProvider, storePassword); }
/** * Loads keystore using an input stream or a file path in the same * order of precedence. * * Required for integrations to be able to override the mechanism * used to load a keystore in order to provide their own implementation. * * @param storeStream keystore input stream * @param storePath path of keystore file * @param storeType keystore type * @param storeProvider keystore provider * @param storePassword keystore password * @return created keystore * @throws Exception */ protected KeyStore getKeyStore(InputStream storeStream, String storePath, String storeType, String storeProvider, String storePassword) throws Exception { return CertificateUtils.getKeyStore(storeStream, storePath, storeType, storeProvider, storePassword); }
/** * Loads keystore using an input stream or a file path in the same * order of precedence. * * Required for integrations to be able to override the mechanism * used to load a keystore in order to provide their own implementation. * * @param storeStream keystore input stream * @param storePath path of keystore file * @param storeType keystore type * @param storeProvider keystore provider * @param storePassword keystore password * @return created keystore * @throws Exception */ protected KeyStore getKeyStore(InputStream storeStream, String storePath, String storeType, String storeProvider, String storePassword) throws Exception { return CertificateUtils.getKeyStore(storeStream, storePath, storeType, storeProvider, storePassword); }
/** * Override this method to provide alternate way to load a truststore. * * @return the key store instance * @throws Exception if the truststore cannot be loaded */ protected KeyStore loadTrustStore() throws Exception { return _trustStore != null ? _trustStore : CertificateUtils.getKeyStore(_trustStoreInputStream, _trustStorePath, _trustStoreType, _trustStoreProvider, _trustStorePassword==null? null: _trustStorePassword.toString()); }
/** * Override this method to provide alternate way to load a keystore. * * @return the key store instance * @throws Exception if the keystore cannot be loaded */ protected KeyStore loadKeyStore() throws Exception { return _keyStore != null ? _keyStore : CertificateUtils.getKeyStore(_keyStoreInputStream, _keyStorePath, _keyStoreType, _keyStoreProvider, _keyStorePassword==null? null: _keyStorePassword.toString()); }
/** * Constructs a KeyStore using the specified filename and password */ protected static KeyStore buildKeyStore(Resource resource, String password) { try { return CertificateUtils.getKeyStore(resource, "JKS", null, password); } catch (Exception ex) { throw new IllegalStateException("Unable to build KeyStore from resource: " + resource.getName(), ex); } }
/** * Override this method to provide alternate way to load a truststore. * * @return the key store instance * @throws Exception if the truststore cannot be loaded */ protected KeyStore loadTrustStore() throws Exception { return _trustStore != null ? _trustStore : CertificateUtils.getKeyStore(_trustStoreInputStream, _trustStorePath, _trustStoreType, _trustStoreProvider, _trustStorePassword==null? null: _trustStorePassword.toString()); }
/** * Override this method to provide alternate way to load a keystore. * * @return the key store instance * @throws Exception if the keystore cannot be loaded */ protected KeyStore loadKeyStore() throws Exception { return _keyStore != null ? _keyStore : CertificateUtils.getKeyStore(_keyStoreInputStream, _keyStorePath, _keyStoreType, _keyStoreProvider, _keyStorePassword==null? null: _keyStorePassword.toString()); }
/** * Override this method to provide alternate way to load a keystore. * * @return the key store instance * @throws Exception if the keystore cannot be loaded */ protected KeyStore loadKeyStore() throws Exception { return _keyStore != null ? _keyStore : CertificateUtils.getKeyStore(_keyStoreInputStream, _keyStorePath, _keyStoreType, _keyStoreProvider, _keyStorePassword==null? null: _keyStorePassword.toString()); }
/** * Override this method to provide alternate way to load a truststore. * * @return the key store instance * @throws Exception if the truststore cannot be loaded */ protected KeyStore loadTrustStore() throws Exception { return _trustStore != null ? _trustStore : CertificateUtils.getKeyStore(_trustStoreInputStream, _trustStorePath, _trustStoreType, _trustStoreProvider, _trustStorePassword==null? null: _trustStorePassword.toString()); }
/** * Loads keystore using an input stream or a file path in the same * order of precedence. * * Required for integrations to be able to override the mechanism * used to load a keystore in order to provide their own implementation. * * @param storePath path of keystore file * @param storeType keystore type * @param storeProvider keystore provider * @param storePassword keystore password * @return created keystore * @throws Exception if unable to get keystore */ protected KeyStore getKeyStore(String storePath, String storeType, String storeProvider, String storePassword) throws Exception { return CertificateUtils.getKeyStore(Resource.newResource(storePath), storeType, storeProvider, storePassword); }
/** * Loads keystore using an input stream or a file path in the same * order of precedence. * * Required for integrations to be able to override the mechanism * used to load a keystore in order to provide their own implementation. * * @param storePath path of keystore file * @param storeType keystore type * @param storeProvider keystore provider * @param storePassword keystore password * @return created keystore * @throws Exception if unable to get keystore */ protected KeyStore getKeyStore(String storePath, String storeType, String storeProvider, String storePassword) throws Exception { return CertificateUtils.getKeyStore(Resource.newResource(storePath), storeType, storeProvider, storePassword); }
/** * Override this method to provide alternate way to load a keystore. * * @param resource the resource to load the keystore from * @return the key store instance * @throws Exception if the keystore cannot be loaded */ protected KeyStore loadKeyStore(Resource resource) throws Exception { String storePassword = Objects.toString(_keyStorePassword, null); return CertificateUtils.getKeyStore(resource, getKeyStoreType(), getKeyStoreProvider(), storePassword); }
@Override protected KeyStore loadTrustStore(Resource resource) throws Exception { return CertificateUtils.getKeyStore( resource != null ? resource : getKeyStoreResource(), Objects.toString(getTrustStoreType(), getKeyStoreType()), Objects.toString(getTrustStoreProvider(), getKeyStoreProvider()), trustStorePassword); } }