Update KeyPair.java

Fix:
If a new KeyPair was created based on an existing PrivateKey the publicKey-field stayed null forever. Each time .getPublicKey() was called the PublicKey was recalculated.

Moved this code in the constructor where it belongs to.