generate a private key from a certificate