Minimal part extracted from bitcoinj for key generation, signing and verifying.