Code example for SecureRandom

0
        ECKeyGenerationParameters   param;
        ECKeyPairGenerator          engine = new ECKeyPairGenerator();
        Object                      ecParams = null;
        int                         strength = 239;
        int                         certainty = 50;
        SecureRandom                random = new SecureRandom();
        boolean                     initialised = false;
        String                      algorithm;
 
        static private Hashtable    ecParameters;
 
        static { 
            ecParameters = new Hashtable();
 
            // BEGIN android-changed 
            ecParameters.put(Integer.valueOf(192), new ECGenParameterSpec("prime192v1")); // a.k.a P-192
            ecParameters.put(Integer.valueOf(239), new ECGenParameterSpec("prime239v1"));
            ecParameters.put(Integer.valueOf(256), new ECGenParameterSpec("prime256v1")); // a.k.a P-256
 
            ecParameters.put(Integer.valueOf(224), new ECGenParameterSpec("P-224"));
            ecParameters.put(Integer.valueOf(384), new ECGenParameterSpec("P-384"));