public void run(int id,int size) throws Exception {
  KeyPairGenerator keyGen=KeyPairGenerator.getInstance("RSA");
  keyGen.initialize(size);
  KeyPair kp=keyGen.generateKeyPair();
  PublicKey puk=kp.getPublic();
  PrivateKey prk=kp.getPrivate();
  saveToFile(id,puk,prk);
}

public void run ( int id , int size ) throws Exception { KeyPairGenerator keyGen = KeyPairGenerator . getInstance ( "RSA" ) ; keyGen . initialize ( size ) ; KeyPair kp = keyGen . generateKeyPair ( ) ; PublicKey puk = kp . getPublic ( ) ; PrivateKey prk = kp . getPrivate ( ) ; saveToFile ( id , puk , prk ) ; }
generate the key pair for the process with id = < id > and put it on the files config / keys / publickey < id > and config / keys / privatekey < id >
