private static SecureRandom CreateSecureRandom()
        {
            /*
             * We use our threaded seed generator to generate a good random seed. If the user
             * has a better random seed, he should use the constructor with a SecureRandom.
             *
             * Hopefully, 20 bytes in fast mode are good enough.
             */
            byte[] seed = new ThreadedSeedGenerator().GenerateSeed(20, true);

            return new SecureRandom(seed);
        }
예제 #2
0
        /*
        * Both streams can be the same object
        */
        public TlsProtocolHandler(
			Stream	inStr,
			Stream	outStr)
        {
            /*
             * We use a threaded seed generator to generate a good random
             * seed. If the user has a better random seed, he should use
             * the constructor with a SecureRandom.
             *
             * Hopefully, 20 bytes in fast mode are good enough.
             */
            byte[] seed = new ThreadedSeedGenerator().GenerateSeed(20, true);

            this.random = new SecureRandom(seed);
            this.rs = new RecordStream(this, inStr, outStr);
        }