public static void createAndStoreCryptographicallyStrongTokenInSession(HttpSession session) { ByteArrayGuardAESCTR guard = new ByteArrayGuardAESCTR(); String clearText = "" + System.currentTimeMillis(); String result = guard.encrypt(clearText); try { result = URLEncoder.encode(result, "UTF-8"); } catch (UnsupportedEncodingException e) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, "Unable to URL encode cryptographically strong token, storing clear text in session instead.", e); } result = clearText; } session.setAttribute(TOKEN_NAME, result); }
public static void createAndStoreCryptographicallyStrongTokenInSession(HttpSession session) { ByteArrayGuardAESCTR guard = new ByteArrayGuardAESCTR(); String clearText = "" + System.currentTimeMillis(); String result = guard.encrypt(clearText); try { result = URLEncoder.encode(result, "UTF-8"); } catch (UnsupportedEncodingException e) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, "Unable to URL encode cryptographically strong token, storing clear text in session instead.", e); } result = clearText; } session.setAttribute(TOKEN_NAME, result); }
public static void createAndStoreCryptographicallyStrongTokenInSession(HttpSession session) { ByteArrayGuardAESCTR guard = new ByteArrayGuardAESCTR(); String clearText = "" + System.currentTimeMillis(); String result = guard.encrypt(clearText); try { result = URLEncoder.encode(result, "UTF-8"); } catch (UnsupportedEncodingException e) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, "Unable to URL encode cryptographically strong token, storing clear text in session instead.", e); } result = clearText; } session.setAttribute(TOKEN_NAME, result); }
public static void createAndStoreCryptographicallyStrongTokenInSession(HttpSession session) { ByteArrayGuardAESCTR guard = new ByteArrayGuardAESCTR(); String clearText = "" + System.currentTimeMillis(); String result = guard.encrypt(clearText); try { result = URLEncoder.encode(result, "UTF-8"); } catch (UnsupportedEncodingException e) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, "Unable to URL encode cryptographically strong token, storing clear text in session instead.", e); } result = clearText; } session.setAttribute(TOKEN_NAME, result); }
/** Creates a new instance of ELFlash */ private ELFlash(ExternalContext extContext) { flashInnerMap = new ConcurrentHashMap<String,Map<String, Object>>(); WebConfiguration config = WebConfiguration.getInstance(extContext); String value; try { value = config.getOptionValue(WebContextInitParameter.NumberOfConcurrentFlashUsers); numberOfConcurentFlashUsers = Integer.parseInt(value); } catch (NumberFormatException nfe) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, "Unable to set number of concurrent flash users. Defaulting to {0}", numberOfConcurentFlashUsers); } } try { value = config.getOptionValue(WebContextInitParameter.NumberOfFlashesBetweenFlashReapings); numberOfFlashesBetweenFlashReapings = Long.parseLong(value); } catch (NumberFormatException nfe) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, "Unable to set number flashes between flash repaings. Defaulting to {0}", numberOfFlashesBetweenFlashReapings); } } distributable = config.isOptionEnabled(EnableDistributable); guard = new ByteArrayGuardAESCTR(); }
/** Creates a new instance of ELFlash */ private ELFlash(ExternalContext extContext) { flashInnerMap = new ConcurrentHashMap<>(); WebConfiguration config = WebConfiguration.getInstance(extContext); String value; try { value = config.getOptionValue(WebContextInitParameter.NumberOfConcurrentFlashUsers); numberOfConcurentFlashUsers = Integer.parseInt(value); } catch (NumberFormatException nfe) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, "Unable to set number of concurrent flash users. Defaulting to {0}", numberOfConcurentFlashUsers); } } try { value = config.getOptionValue(WebContextInitParameter.NumberOfFlashesBetweenFlashReapings); numberOfFlashesBetweenFlashReapings = Long.parseLong(value); } catch (NumberFormatException nfe) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, "Unable to set number flashes between flash repaings. Defaulting to {0}", numberOfFlashesBetweenFlashReapings); } } distributable = config.isOptionEnabled(EnableDistributable); guard = new ByteArrayGuardAESCTR(); }
/** Creates a new instance of ELFlash */ private ELFlash(ExternalContext extContext) { flashInnerMap = new ConcurrentHashMap<>(); WebConfiguration config = WebConfiguration.getInstance(extContext); String value; try { value = config.getOptionValue(WebContextInitParameter.NumberOfConcurrentFlashUsers); numberOfConcurentFlashUsers = Integer.parseInt(value); } catch (NumberFormatException nfe) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, "Unable to set number of concurrent flash users. Defaulting to {0}", numberOfConcurentFlashUsers); } } try { value = config.getOptionValue(WebContextInitParameter.NumberOfFlashesBetweenFlashReapings); numberOfFlashesBetweenFlashReapings = Long.parseLong(value); } catch (NumberFormatException nfe) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, "Unable to set number flashes between flash repaings. Defaulting to {0}", numberOfFlashesBetweenFlashReapings); } } distributable = config.isOptionEnabled(EnableDistributable); guard = new ByteArrayGuardAESCTR(); }
/** Creates a new instance of ELFlash */ private ELFlash(ExternalContext extContext) { flashInnerMap = new ConcurrentHashMap<>(); WebConfiguration config = WebConfiguration.getInstance(extContext); String value; try { value = config.getOptionValue(WebContextInitParameter.NumberOfConcurrentFlashUsers); numberOfConcurentFlashUsers = Integer.parseInt(value); } catch (NumberFormatException nfe) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, "Unable to set number of concurrent flash users. Defaulting to {0}", numberOfConcurentFlashUsers); } } try { value = config.getOptionValue(WebContextInitParameter.NumberOfFlashesBetweenFlashReapings); numberOfFlashesBetweenFlashReapings = Long.parseLong(value); } catch (NumberFormatException nfe) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, "Unable to set number flashes between flash repaings. Defaulting to {0}", numberOfFlashesBetweenFlashReapings); } } distributable = config.isOptionEnabled(EnableDistributable); guard = new ByteArrayGuardAESCTR(); }