diff options
Diffstat (limited to 'OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/util/TestingUtils.java')
-rw-r--r-- | OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/util/TestingUtils.java | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/util/TestingUtils.java b/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/util/TestingUtils.java index ee0379653..f45e82c3e 100644 --- a/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/util/TestingUtils.java +++ b/OpenKeychain-Test/src/test/java/org/sufficientlysecure/keychain/util/TestingUtils.java @@ -1,16 +1,29 @@ package org.sufficientlysecure.keychain.util; +/* + * Copyright (C) 2014 Vincent Breitmoser <v.breitmoser@mugenguild.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ import java.util.Random; -/** - * Created by valodim on 9/15/14. - */ public class TestingUtils { - public static String genPassphrase() { + public static Passphrase genPassphrase() { return genPassphrase(false); } - public static String genPassphrase(boolean noEmpty) { + public static Passphrase genPassphrase(boolean noEmpty) { String chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789!@#$%^&*()-_="; Random r = new Random(); StringBuilder passbuilder = new StringBuilder(); @@ -19,6 +32,6 @@ public class TestingUtils { passbuilder.append(chars.charAt(r.nextInt(chars.length()))); } System.out.println("Generated passphrase: '" + passbuilder.toString() + "'"); - return passbuilder.toString(); + return new Passphrase(passbuilder.toString()); } } |