def certificate_focus_cert(self):
dbServerCertificate = self._certificate_focus()
if self.request.matchdict['format'] == 'pem':
self.request.response.content_type = 'application/x-pem-file'
return dbServerCertificate.cert_pem
elif self.request.matchdict['format'] == 'pem.txt':
return dbServerCertificate.cert_pem
elif self.request.matchdict['format'] == 'crt':
as_der = lib_cert_utils.convert_pem_to_der(pem_data=dbServerCertificate.cert_pem)
response = Response()
response.content_type = 'application/x-x509-server-cert'
response.body = as_der
return response
return 'cert.pem'
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
评论列表
文章目录