Originally Posted by JenniJenni
Thanks a lot.
But still I am not clear. Whether the pseduocode above what I have placed and my understanding is correct or wrong/
If you and the recipient have exchanged keys then the message is encrypted using the recipient's public key and appends the digital signature from your public key to verify that the package and or message was originally from you.
The file is decrypted using the recipient's private key and their system uses the signature from your public key to confirm the sending user.