private string GetTagValue(CertificateType certificateType)
 {
     if (_letsEncryptOptions.UseStaging)
     {
         return($"{certificateType}-Staging");
     }
     else
     {
         return(certificateType.ToString());
     }
 }
            public void Should_Add_Certificate_Type_If_Provided(CertificateType certificateType)
            {
                // Given
                var fixture = new FastlaneMatchFixture();

                fixture.Settings.CertificateType = certificateType;

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal($"match {certificateType.ToString().ToLowerInvariant()}", result.Args);
            }
Exemplo n.º 3
0
        private void OpenCertificateView(CertificateType type)
        {
            var listOfTableRow = CertificateList.FindElements(By.CssSelector("tr[data-id]"));

            foreach (var tableRow in listOfTableRow)
            {
                var td     = tableRow.FindElement(By.CssSelector("td[data-label='Code:'"));
                var a      = td.FindElement(By.TagName("a"));
                var imgSrc = a.GetAttribute("data-prefix");

                if (imgSrc.Contains(type.ToString()))
                {
                    a.Click();
                    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5));
                    wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(CreateNewCertificateButton));

                    CreateNewCertificateButton.Click();
                    break;
                }
            }
        }
Exemplo n.º 4
0
        private ExistingCertListPage SelectTypeFromDropdownListOfTypes(CertificateType dPN18C)
        {
            CertificateTypeDropdown.Click();
            var  listOfOptions      = CertificateTypeDropdown.FindElements(By.TagName("option"));
            bool isCertificateFound = false;

            foreach (var option in listOfOptions)
            {
                if (option.Text.Contains(dPN18C.ToString()))
                {
                    isCertificateFound = true;
                    option.Click();
                    break;
                }
            }

            if (!isCertificateFound)
            {
                throw new Exception("Certificate type now found.");
            }

            return(this);
        }
Exemplo n.º 5
0
 private string GetCertificatePath(CertificateType persistenceType)
 {
     return(relativeFilePath + "_" + persistenceType.ToString());
 }
        public string MemUploadImgBit()
        {
            int    _pictype = QueryString.IntSafeQ("pictype");
            string filename = QueryString.SafeQ("name");

            using (Stream filesStream = System.Web.HttpContext.Current.Request.InputStream)
            {
                CertificateType _certype = (CertificateType)_pictype;

                byte[] bytes = new byte[filesStream.Length];
                filesStream.Read(bytes, 0, bytes.Length);
                // 设置当前流的位置为流的开始
                filesStream.Seek(0, SeekOrigin.Begin);
                FtpUtil _ftp        = new FtpUtil();
                Random  _rd         = new Random();
                string  dicpath     = FilePath.PathCombine(ConfigCore.Instance.ConfigCommonEntity.FtpImagesSystemName, _certype.ToString(), memid.ToString(), DateTime.Now.ToString("yyyy"), DateTime.Now.ToString("MM"), DateTime.Now.ToString("dd"), _rd.Next(100000, 999999).ToString());
                string  dicpathfull = dicpath + filename.Substring(filename.LastIndexOf("."));
                string  certifapath = FilePath.PathCombine(ConfigCore.Instance.ConfigCommonEntity.FtpImagesRootPath, dicpathfull);
                _ftp.UploadFile(certifapath, bytes, true);
                return("{\"jsonrpc\" : \"2.0\", \"result\" : null, \"pic_raw\" : \"" + dicpathfull + "\"}");
            }

            return("");
        }
        public string MemUploadImg()
        {
            HttpFileCollection files = System.Web.HttpContext.Current.Request.Files;
            int             aa       = files.Count;
            int             _pictype = FormString.IntSafeQ("pictype");
            HttpPostedFile  file     = System.Web.HttpContext.Current.Request.Files[0];
            CertificateType _certype = (CertificateType)_pictype;

            if (file != null)
            {
                byte[] bytes = null;
                using (var binaryReader = new BinaryReader(file.InputStream))
                {
                    bytes = binaryReader.ReadBytes(file.ContentLength);
                }
                FtpUtil _ftp        = new FtpUtil();
                Random  _rd         = new Random();
                string  dicpath     = FilePath.PathCombine(ConfigCore.Instance.ConfigCommonEntity.FtpImagesSystemName, _certype.ToString(), memid.ToString(), DateTime.Now.ToString("yyyy"), DateTime.Now.ToString("MM"), DateTime.Now.ToString("dd"), _rd.Next(100000, 999999).ToString());
                string  dicpathfull = dicpath + file.FileName.Substring(file.FileName.LastIndexOf("."));
                string  certifapath = FilePath.PathCombine(ConfigCore.Instance.ConfigCommonEntity.FtpImagesRootPath, dicpathfull);
                _ftp.UploadFile(certifapath, bytes, true);
                return("{\"jsonrpc\" : \"2.0\", \"result\" : null, \"pic_raw\" : \"" + dicpathfull + "\"}");
            }

            return("");
        }
Exemplo n.º 8
0
 public void ConfigureCertificateStore(CertificateType type, byte[] data)
 {
     ConfigureCertificateStore(type.ToString().ToLower(), data);
 }