Package ninja.utils

Class SecretGenerator


  • public class SecretGenerator
    extends Object
    • Constructor Detail

      • SecretGenerator

        public SecretGenerator()
    • Method Detail

      • generateSecret

        public static String generateSecret()
        Generates a random String of length 64. This string is suitable as secret for your application (key "application.secret" in conf/application.conf).
        Returns:
        A string that can be used as "application.secret".
      • generateSecret

        protected static String generateSecret​(Random random)
        !!!! Only for testing purposes !!!! Usually you want to use generateSecret()
        Parameters:
        random - the random generator to use. Usually new Random(), but for testing you can use a predefined seed.
        Returns:
        A String suitable as random secret for eg signing a session.