public void startKeyPairGeneration(){
  generator=new Thread(new GenerateKeyPair());
  generator.setPriority(Thread.MIN_PRIORITY);
  generator.start();
}

public void startKeyPairGeneration ( ) { generator = new Thread ( new GenerateKeyPair ( ) ) ; generator . setPriority ( Thread . MIN_PRIORITY ) ; generator . start ( ) ; }
start key pair generation in a separate thread .
