RSA is a public-key cryptosystem. This means that you publish your public key in order for people to encrypt and you use your private key in order to decrypt.
When signing a message, you create extra information, meaning you don't change what you send, you just add a value. Then, the receiver can check that the signature is valid and "believe" that he/she didn't received the message from an imposter.
Answering your question, because you want to create a passphrase and not store the hard coded password as a plain text, signing doesn't work because you don't encrypt anything but rather just ensures that you (the one with the generated RSA pair key) have indeed stored that password.
What you probably want if I'm understanding correctly is hashing the password and store the hash as hard coded. So basically you can use a popular hash function like SHA-256 and hash your password. For example, the password "passphrase" is hashed as 1e089e3c5323ad80a90767bdd5907297b4138163f027097fd3bdbeab528d2d68.
The convenient thing about hash functions is that you can't go back, meaning given 1e089e3c5323ad80a90767bdd5907297b4138163f027097fd3bdbeab528d2d68, you can't find the word "passphrase". Another convenient thing is that it is "almost" always, collision free, meaning that no other word could produce the same hash. Lastly, "passphrasee" (an extra e) gives as a hash ea1c584e4a0e8aac0647a0cf91bb102113e633a0be24d8901135d2b501f6958f, a completely different hash. This way, you don't know if you are "near" of finding the original word.
So, you keep the hash, and each time a user tries to input the passphrase, you will hash it with the same hash function. If the output is the same as the hash you have stored, then you know the person knows the correct password. If the output isn't the same as the hash, then the user wrote an incorrect password. Even if someone looks the hard coded hash, he wouldn't be able to find the real passphrase.