1 Answers
A Private key is a key that is associated to you as the user, you must keep this secured safely and encypted. A private key can decrypt a message from a server and send it back for verification. A public key is used to encrpyt a message from the server and send it to the client (e.g. you the user). I hope this helps answer your question but there are a lot if links online that you can look at as well about SSH keys.
You key pair has two parts (private and public). The public part of your key is stored on EC2 instance associated with a user. When connecting through SSH, the instance controls the public part of the key and then you shall provide the private part of the key to decode the encrypted connection. As a note: public and private parts of the key exist in the same file in case you use tools like putty for connection. Different tools may accept different formats of keypairs.