A trap-door is an inverse function known only to the agent. The public key is the key that is published, known to all who may correspond with the agent. Then only that party can decode the message as it takes their private key to do it. Authentication is achieved by encoding a message in you own private key before transmitting. Anyone decoding it must use your public key and if successful they can be confident that the message originated from you.
Integrity is achieved also using one's private key.
The sender takes the message or document, makes a duplicate copy of it and encodes the duplicate. Also attached could be your signature encoded in your private key. Then again, using your public key, they may decode the signature to validate it for authenticity. Another feature of the algorithm allows one to encode an already encoded message and be able to restore the original message. This allows privacy, authentication, and integrity at the same time.