public JsonResult SearchCertificates(string query)
        {
            return(Json(new { data = certificateRepository.FindCertificates(query) }));

            //DownloadPfxCertificateEntity cert = certificateRepository.GetCertificate<DownloadPfxCertificateEntity>(id);


            //if(!cert.HasPrivateKey || cert.CertificateStorageFormat != CertificateStorageFormat.Pfx)
            //{
            //    throw new Exception("No private key");
            //}

            //return new FileContentResult(Convert.FromBase64String(cert.Content), pfxMimeType)
            //{
            //    FileDownloadName = String.Format("{0}.pfx", cert.Thumbprint)
            //};
        }