views:

526

answers:

1

I am looking to encrypt files with X509 certificates using public and private keys and send them to a remote server. How would I do this? Is this even possible? How do I generate the certificate and then the public and private key pairs?

+2  A: 

See this SO question how to create a RSACryptoServiceProvider from a X509Certificate2 that can be used to encrypt and decrypt files.

The .NET framework does not contain classes to generate X.509 certificates. Mono's security classes (Mono.Security.X509) and BouncyCastle support the creation of X.509 certificates from C#. Alternatively, you can use tools like OpenSSL or makecert.exe to generate certificates.

dtb
Thank you for your help!
Greg Finzer