From 5951b32f8ed667be65a6b5464bf608c4d22c40c1 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Sat, 25 Jan 2014 11:50:18 +0100 Subject: [PATCH] added main method for an easy way to generate static keys --- .../sonia/scm/security/DefaultKeyGenerator.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scm-webapp/src/main/java/sonia/scm/security/DefaultKeyGenerator.java b/scm-webapp/src/main/java/sonia/scm/security/DefaultKeyGenerator.java index 2ed55e4487..149840b106 100644 --- a/scm-webapp/src/main/java/sonia/scm/security/DefaultKeyGenerator.java +++ b/scm-webapp/src/main/java/sonia/scm/security/DefaultKeyGenerator.java @@ -30,6 +30,7 @@ */ + package sonia.scm.security; //~--- non-JDK imports -------------------------------------------------------- @@ -68,6 +69,17 @@ public class DefaultKeyGenerator implements KeyGenerator //~--- methods -------------------------------------------------------------- + /** + * Method description + * + * + * @param args + */ + public static void main(String[] args) + { + System.out.println(new DefaultKeyGenerator().createKey()); + } + /** * Method description * @@ -107,8 +119,8 @@ public class DefaultKeyGenerator implements KeyGenerator //~--- fields --------------------------------------------------------------- /** Field description */ - private AtomicLong sessionKey = new AtomicLong(); + private final AtomicLong sessionKey = new AtomicLong(); /** Field description */ - private Random random = new Random(); + private final Random random = new Random(); }