PKI is necessary when you want to use public key cryptography. This method uses different types of digital certificates for storing public and private keys. The digital certificates also work to decrypt and encrypt data sent or received, using both types of keys. The type of transmission and whether you are a sender or receiver will determine how data is encrypted or decrypted, as well as what type of key you need to use.
How Data is Encrypted and Decrypted When You Use PKI
The PKI encryption process uses a public key to encrypt data which is sent across the internet. For example, you want to send your stock broker information regarding your account. Once your stock broker receives your information, they decrypt your message by using their private key. Their private key has to a match to your public key -- otherwise the decryption process will not work.