From 111d7e2bb3c4fbfed8b448633d3e8c1c6e5661db Mon Sep 17 00:00:00 2001 From: tkellner Date: Fri, 27 Jan 2012 15:26:49 +0000 Subject: Replace (important) instances of Random with SecureRandom git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1023 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- smcc/src/main/java/at/gv/egiz/smcc/DNIeCryptoUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'smcc/src/main/java/at/gv') diff --git a/smcc/src/main/java/at/gv/egiz/smcc/DNIeCryptoUtil.java b/smcc/src/main/java/at/gv/egiz/smcc/DNIeCryptoUtil.java index c4e27d08..75095c10 100644 --- a/smcc/src/main/java/at/gv/egiz/smcc/DNIeCryptoUtil.java +++ b/smcc/src/main/java/at/gv/egiz/smcc/DNIeCryptoUtil.java @@ -32,6 +32,7 @@ import java.security.InvalidKeyException; import java.security.Key; import java.security.KeyFactory; import java.security.MessageDigest; +import java.security.SecureRandom; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.cert.CertificateFactory; @@ -42,7 +43,6 @@ import java.security.spec.KeySpec; import java.security.spec.RSAPrivateKeySpec; import java.security.spec.RSAPublicKeySpec; import java.util.Arrays; -import java.util.Random; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; @@ -122,7 +122,7 @@ public class DNIeCryptoUtil { for (int i = 0; i < length; i++) { - Random rand = new Random(); + SecureRandom rand = new SecureRandom(); byte current = (byte) rand.nextInt(255); result[i] = current; } -- cgit v1.2.3