If the digital certificate you are exporting is for personal use, or a backup key, we must export it with a private key.
The private key must remain under the absolute control of its owner. This feature allows an electronic signature to uniquely identify the signer.
On the other hand, if the goal is to communicate with someone securely, just export it with a public key and communicate this to the other person. The public key allows the recipient to verify who is the author of the message and the integrity of the data sent.
Both keys act complementary: who encrypts, can only be decrypted by the other part.
By way of example
As an example, if a sender uses a recipient\’s public key to encrypt a message, once encrypted, only the recipient\’s private key can decrypt the message as he is the only one who knows it. Therefore the confidentiality of sending the message is achieved, so no one except the recipient can decrypt it.