It is common to upload / transfer certificates as base64 strings.
A common example is Azure Management API Add Service Certificate.
To encode a certificate all you have to do is simply encode the certificate file.
var encodedClientCert = Convert.ToBase64String(File.ReadAllBytes("Client.Cer"));
string str = "base64string representing a certificate"; string psw = "password for certificates with a private key"; var cert = new X509Certificate2(Convert.FromBase64String(str), psw);
Hope this helps