Ejemplo n.º 1
0
        public ActionResult <string> GetClientCsr([FromServices] ISafeguardLogic safeguard, [FromQuery] int?size,
                                                  [FromQuery] string subjectName, [FromQuery] string sanDns, [FromQuery] string sanIp, [FromQuery] string certType = "A2AClient")
        {
            if (!Enum.TryParse(certType, true, out CertificateType cType))
            {
                return(BadRequest("Invalid certificate type"));
            }

            var csr = safeguard.GetCSR(size, subjectName, sanDns, sanIp, cType);

            return(Ok(csr));
        }