I am using PolkadotJS, I can sign the message, and get the public key, but I don't know the way to get the private key. Could you please let me know how to get the private key? Thank you so much.
Polkadot js apps does not support this. The only instance where you can have access to the private key is when generating the account. Once generated, you are asked to save a json in a safe place. In this file, you can find the private key, encoded by the password that you set for your account.
Perhaps this feature can be added, although my guess is that currently Polakdot js apps is doing this to protect the users and prevents them from leaking their private key. Storing and displaying the private key in online web app sounds like the last thing you want to do.