One can even sign an encrypted message this way. Suppose Alice wants to send Bob an encrypted message. Then she first encrypts with Bob's public n(B) and e(B). Secondly, she signs the message with her n(A) and private d(A). Since her d(A) is different from Bob's d(B), they don't cancel out. Then Bob can "unsign" the message with Alice's public n(A) and e(A) and finally decrypt the message with his n(B) and private d(B)!
Example:
Alice
(private)
(public)
(public)
(private)
Bob
(private)
(public)
(public)
(private)
Alice encrypts the message with Bob's public information:
Alice signs the message with her private information and send the result to Bob:
Bob "unsigns" the message using Alice's public information:
and then decrypts it using his private information: