class JDBCSSHRecordStoreFactory implements SSHRecordStoreFactory {

    @Override
    public SSHRecordStore create(PrivateKeyStore keyStore) {
        
        final String jdbcStore = System.getProperty(ZTSConsts.ZTS_PROP_SSH_JDBC_STORE);
        final String jdbcUser = System.getProperty(ZTSConsts.ZTS_PROP_SSH_JDBC_USER);
        final String password = System.getProperty(ZTSConsts.ZTS_PROP_SSH_JDBC_PASSWORD, "");
        final String jdbcAppName = System.getProperty(ZTSConsts.ZTS_PROP_SSH_JDBC_APP_NAME, JDBC);

        String jdbcPassword = keyStore.getApplicationSecret(jdbcAppName, password);
            
        Properties props = new Properties();
        props.setProperty(ZTSConsts.DB_PROP_USER, jdbcUser);
        props.setProperty(ZTSConsts.DB_PROP_PASSWORD, jdbcPassword);
        props.setProperty(ZTSConsts.DB_PROP_VERIFY_SERVER_CERT,
                System.getProperty(ZTSConsts.ZTS_PROP_SSH_JDBC_VERIFY_SERVER_CERT, "false"));
        props.setProperty(ZTSConsts.DB_PROP_USE_SSL,
                System.getProperty(ZTSConsts.ZTS_PROP_SSH_JDBC_USE_SSL, "false"));

        PoolableDataSource src = DataSourceFactory.create(jdbcStore, props);

        // set default timeout for our connections

        JDBCSSHRecordStore certStore = new JDBCSSHRecordStore(src);
        int opTimeout = Integer.parseInt(System.getProperty(ZTSConsts.ZTS_PROP_SSH_OP_TIMEOUT, "10"));
        certStore.setOperationTimeout(opTimeout);

        return certStore;
    }

}