Inheritance: System.Exception
 public static string ExportToPrivateSshKey(X509Certificate2 cert)
 {
     if (cert == null)
     {
         throw new ArgumentException(nameof(cert));
     }
     if (!cert.HasPrivateKey)
     {
         throw new CryptoException(string.Format("Could not ExportToPrivateSshKey; Tumbprint '{0}' does not have a private key. See inner exception for details.", cert.Thumbprint));
     }
     try
     {
         return ExportToSshKey(GetRSACryptoServiceProviderFromPrivateKey(cert), true);
     }
     catch (Exception ex)
     {
         var outer = new CryptoException(string.Format("Could not ExportToPrivateSshKey; Tumbprint '{0}'. See inner exception for details.", cert.Thumbprint), ex);
         throw outer;
     }
 }