Code example for SecureRandom

0
 
        DHKeyGenerationParameters  param;
        DHBasicKeyPairGenerator    engine = new DHBasicKeyPairGenerator();
        int                        strength = 1024;
        int                        certainty = 20;
        SecureRandom               random = new SecureRandom();
        boolean                    initialised = false;
 
        public DH() 
        { 
            super("DH"); 
        } 
 
        public void initialize( 
            int             strength,
            SecureRandom    random)
        { 
            this.strength = strength;
            this.random = random;
        }