I want to create an Ethereum wallet, and I need an address and a private key, but I am unable to generate both. Please suggest a way to generate key pairs.
Creating a new account with JSON RPC makes the client handle the keystore. Usually it's saved in a
.json file locally.
Check this question about how to create a new account, but note that the private key will not be returned.
If you want to create a wallet and have access to the private key, the go-ethereum client might be useful. Use the libraries directly and generate your own wallets.
For example import the crypto library
And generate your account
key, err := crypto.GenerateKey()
To get the private key do