Esempio n. 1
0
        public ActionResult InstallClientCertificate([FromServices] ISafeguardLogic safeguard, CertificateInfo certInfo)
        {
            safeguard.InstallCertificate(certInfo, CertificateType.A2AClient);
            var certificate = safeguard.GetCertificateInfo(CertificateType.A2AClient);

            return(Ok(certificate));
        }
Esempio n. 2
0
        public ActionResult <ServiceConfiguration> ConfigureSafeguard([FromServices] ISafeguardLogic safeguard, CertificateInfo certFile = null)
        {
            if (certFile?.Base64CertificateData != null)
            {
                safeguard.InstallCertificate(certFile, CertificateType.A2AClient);
            }

            var devOpsConfiguration = safeguard.ConfigureDevOpsService();

            return(Ok(devOpsConfiguration));
        }
Esempio n. 3
0
        public ActionResult InstallWebServerCertificate([FromServices] ISafeguardLogic safeguard, [FromBody] CertificateInfo certInfo, [FromQuery] bool restart = true)
        {
            safeguard.InstallCertificate(certInfo, CertificateType.WebSsl);
            var certificate = safeguard.GetCertificateInfo(CertificateType.WebSsl);

            if (restart)
            {
                safeguard.RestartService();
            }

            return(Ok(certificate));
        }