def add_certificate(self, tenant, alias,certificate_id, certificate, private_key,certificate_type): code, msg = self.__check_certificate_alias(tenant, alias) if code != 200: return code, msg, None if cert_is_effective(certificate): certificate = base64.b64encode(certificate) certificate = domain_repo.add_certificate(tenant.tenant_id, alias, certificate_id,certificate, private_key,certificate_type) return 200, "success", certificate return 400, u'证书无效',certificate
def add_certificate(self, tenant, alias, certificate_id, certificate, private_key, certificate_type): self.__check_certificate_alias(tenant, alias) cert_is_effective(certificate, private_key) certificate = base64.b64encode(bytes(certificate, 'utf-8')) certificate = domain_repo.add_certificate(tenant.tenant_id, alias, certificate_id, certificate, private_key, certificate_type) return certificate
def add_certificate(self, tenant, alias, certificate_id, certificate, private_key, certificate_type): self.__check_certificate_alias(tenant, alias) cert_is_effective(certificate) certificate = base64.b64encode(certificate) certificate = domain_repo.add_certificate(tenant.tenant_id, alias, certificate_id, certificate, private_key, certificate_type) return 200, "success", certificate
def add_certificate(self, tenant, alias, certificate, private_key): code, msg = self.__check_certificate_alias(tenant, alias) if code != 200: return code, msg, None certificate = domain_repo.add_certificate(tenant.tenant_id, alias, certificate, private_key) return 200, "success", certificate