How can I encrypt, decrypt and sign using .pfx certificate?
I have a .pfx certificate file on my computer. I want to to encrypt a message with its public key, and then decrypt it with the private. Also I want to sign another message with its private key, and then check the signature. And I need to get the information about the sertificate the message was signed with from that message. How can I do it using System.Security.Cryptography? You can open the PFX in .NET, like the following: var path = <YOUR PFX FILE PATH>; var password = <YOUR PASSWORD>; var collection = new X509Certificate2Collection(); collection.Import(path, password, X509KeyStorageFlags