class CredentialsGenerator {

    public String next(int length) {
        StringBuilder credential = new StringBuilder(length);
        for (int i = 0; i < length; i++) {
            int randomIndex = randomGenerator.nextInt(LEGAL_CHARACTERS.length);
            credential.append(LEGAL_CHARACTERS[randomIndex]);
        }
        return credential.toString();
    }

    public  CredentialsGenerator();
    protected  CredentialsGenerator(SecureRandom randomGenerator);

}