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)); }
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; }