File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
src/main/java/org/kopi/ebics Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -61,16 +61,6 @@ public static KeyPair makeKeyPair(int keyLen) throws NoSuchAlgorithmException {
6161
6262 }
6363
64- /**
65- * Generates a random password
66- *
67- * @return the password
68- */
69- public static String generatePassword () {
70- String pwd = Base64 .encodeBase64String (Utils .secureRandom .generateSeed (5 ));
71- return pwd .substring (0 , pwd .length () - 2 );
72- }
73-
7464 /**
7565 * Returns the digest value of a given public key.
7666 *
Original file line number Diff line number Diff line change @@ -123,11 +123,17 @@ public static byte[] zip(byte[] toZip) throws EbicsException {
123123 * @return a random nonce.
124124 */
125125 public static byte [] generateNonce () {
126- return secureRandom . generateSeed (16 );
126+ return nextRandomBytes (16 );
127127 }
128128
129129 public static byte [] generateKey () {
130- return secureRandom .generateSeed (16 );
130+ return nextRandomBytes (16 );
131+ }
132+
133+ private static byte [] nextRandomBytes (int n ) {
134+ byte [] data = new byte [n ];
135+ secureRandom .nextBytes (data );
136+ return data ;
131137 }
132138
133139 /**
You can’t perform that action at this time.
0 commit comments