adds generatePrivateKey method with basic tests