public void generateActivationKey() { try { SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); byte data[] = new byte[8]; random.nextBytes(data); activationKey = Util.hex(data); } catch (NoSuchAlgorithmException ex) { LOG.error("Error generating activation key", ex); throw new RuntimeException(ex.getMessage()); } }