Commit 29c22594 authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_certificate_authority: Implement revoke on caucase

parent e8be15fe
......@@ -134,6 +134,9 @@ class CaucaseConnector(XMLObject):
def getCertificate(self, csr_id):
return self._getAuthenticatedConnection().getCertificate(csr_id)
def revokeCertificate(self, crt_pem, key_pem=None):
if key_pem is None:
return self._getAuthenticatedConnection().revokeCertificate(crt_pem)
return self._getConnection().revokeCertificate(crt_pem, key_pem)
InitializeClass(CaucaseConnector)
......@@ -118,12 +118,13 @@ class CertificateLoginMixin:
raise ValueError("You cannot revoke certificates from prior implementation!")
if self.getSourceReference() is not None:
raise NotImplementedError()
caucase_connector = self._getCaucaseConnector()
crt_pem = caucase_connector.getCertificate(self.getSourceReference())
caucase_connector.revokeCertificate(crt_pem)
else:
raise ValueError("No certificate found to revoke!")
security.declarePublic('revokeCertificate')
security.declarePrivate('revokeCertificate')
def revokeCertificate(self):
"""Revokes existing certificate"""
self._revokeCertificate()
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment