bftsmart.tom.util

## Class RSAKeyPairGenerator

- java.lang.Object
- - bftsmart.tom.util.RSAKeyPairGenerator

    public class RSAKeyPairGenerator
    extends java.lang.Object

Utility class used to generate a key pair for some process id on config/keys/publickey<id> and config/keys/privatekey<id>

### Constructor Summary

Constructors
Constructor and Description
`RSAKeyPairGenerator()` Creates a new instance of KeyPairGenerator

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static void` `main(java.lang.String[] args)`
`void` `run(int id, int size)` 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>

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### RSAKeyPairGenerator

    public RSAKeyPairGenerator()

Creates a new instance of KeyPairGenerator

### Method Detail

#### run

    public void run(int id,
                    int size)
             throws java.lang.Exception

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>

Parameters:
  `id` - the id of the process to generate key
Throws:
  `java.lang.Exception` - something goes wrong when writing the files

#### main

    public static void main(java.lang.String[] args)