Пример #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));
            }
        }