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 --- BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BKUWebStart/src') diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java index 7744b166..bb81c94b 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/TLSServerCA.java @@ -44,10 +44,10 @@ import java.security.GeneralSecurityException; import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.KeyStore; +import java.security.SecureRandom; import java.security.NoSuchAlgorithmException; import java.util.Calendar; import java.util.GregorianCalendar; -import java.util.Random; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -80,7 +80,7 @@ public class TLSServerCA { caKeyPair = generateKeyPair(); caCert = new X509Certificate(); - caCert.setSerialNumber(new BigInteger(20, new Random())); + caCert.setSerialNumber(new BigInteger(20, new SecureRandom())); caCert.setSubjectDN(subject); caCert.setPublicKey(caKeyPair.getPublic()); caCert.setIssuerDN(subject); @@ -116,7 +116,7 @@ public class TLSServerCA { serverKeyPair = generateKeyPair(); serverCert = new X509Certificate(); - serverCert.setSerialNumber(new BigInteger(20, new Random())); + serverCert.setSerialNumber(new BigInteger(20, new SecureRandom())); serverCert.setSubjectDN(subject); serverCert.setPublicKey(serverKeyPair.getPublic()); serverCert.setIssuerDN(caCert.getSubjectDN()); -- cgit v1.2.3