Esempio n. 1
0
        public async Task <CertificateRequest> CreateExistingCertificate(CertificateRequest incomingCertificate)
        {
            bool isValid = incomingCertificate.IsValid();

            if (!isValid)
            {
                throw new Exception("Object is not valid");
            }
            incomingCertificate.AlreadyCreated = false;

            return(await _dataCtx.Certificates.Insert(incomingCertificate));
        }
Esempio n. 2
0
 public static bool IsValidForGeneration(this CertificateRequest certificate)
 {
     if (!certificate.IsValid())
     {
         return false;
     }
     if (certificate.Duration == 0)
     {
         return false;
     }
     if (certificate.Request == null)
     {
         return false;
     }
     return true;
 }