Exemple #1
0
        private byte[] GetCertificateData()
        {
            if (((CertToDeploy is PSObject) && ((PSObject)CertToDeploy).ImmediateBaseObject is X509Certificate2) ||
                (CertToDeploy is X509Certificate2))
            {
                var cert = ((PSObject)CertToDeploy).ImmediateBaseObject as X509Certificate2;

                return(CertUtils.GetCertificateData(cert));
            }
            else
            {
                var certPath = this.ResolvePath(CertToDeploy.ToString());
                return(CertUtils.GetCertificateData(certPath, Password));
            }
        }
Exemple #2
0
 private byte[] GetCertificateData()
 {
     if ((CertToDeploy is PSObject) && ((PSObject)CertToDeploy).ImmediateBaseObject is X509Certificate2)
     {
         var cert = ((PSObject)CertToDeploy).ImmediateBaseObject as X509Certificate2;
         return(CertUtilsNewSM.GetCertificateData(cert));
     }
     else if (CertToDeploy is X509Certificate2)
     {
         return(CertUtilsNewSM.GetCertificateData(CertToDeploy as X509Certificate2));
     }
     else
     {
         var certPath = this.ResolvePath(CertToDeploy.ToString());
         return(File.ReadAllBytes(certPath));
     }
 }