private long randomSerial() {
        final Random rnd = new Random();
        rnd.setSeed(System.currentTimeMillis());
        // prevent browser certificate caches, cause of doubled serial numbers
        // using 48bit random number
        long sl = ((long) rnd.nextInt()) << 32 | (rnd.nextInt() & 0xFFFFFFFFL);
        // let reserve of 16 bit for increasing, serials have to be positive
        sl = sl & 0x0000FFFFFFFFFFFFL;
        return sl;
    }
Generate a root keystore by a given {@link JKS}.

@param jks A java keystore object.
@return A root {@link KeyStore}.
netbare-core/src/main/java/com/github/megatronking/netbare/ssl/CertificateGenerator.java