I recently faced the same error, and in my case it was the private key. I had to resort to a roundabout way to get a working pair of private-public keys, see my question and answer here