Both a private and a public key must be generated in order to use public key encryption. The public key is required for encryption while the private key is used to decrypt. The originating computer - the computer receiving the encrypted message - needs to generate the key pair. The public key will be given to the computer sending the encrypted message, but the private key will only be known to the originating computer since it is used for decryption.
Feel free to skip ahead to see how to find the network security key. A network security key is a fancy way of saying a Wi-Fi password.