Пример #1
0
 public static X509Certificate2 LoadPem(this X509Certificate2 @this, byte[] certBuffer, byte[] privateKeyBuffer = null)
 {
     try
     {
         return(PemCertificateHelper.ReadPemCertificateWithPrivateKey(certBuffer, privateKeyBuffer));
     }
     catch (Exception ex)
     {
         throw new Exception($"Pem certificate buffer could not be loaded", ex);
     }
 }
Пример #2
0
 public static X509Certificate2 LoadPem(this X509Certificate2 @this, string certFile, string privateKeyFile = null)
 {
     try
     {
         return(PemCertificateHelper.ReadPemCertificateWithPrivateKey(certFile, privateKeyFile));
     }
     catch (Exception ex)
     {
         throw new Exception($"Pem certificate {certFile} could not be loaded", ex);
     }
 }