Support client certificate import
In addition, add getters for certificate fields, and ensure certificate object has short lifespan, since it might change in storage Change-Id: I2abbec0e48d82d432c9cc18afaca62bae7558d7c
This commit is contained in:
@@ -30,8 +30,8 @@ class NsxLibTrustManagement(utils.NsxLibApiBase):
|
||||
"""
|
||||
lines = pem.split(b'\n')
|
||||
result = lines[0] + b'\n'
|
||||
result += b''.join(lines[1:-1])
|
||||
result += b'\n' + lines[-1]
|
||||
result += b''.join(lines[1:-2])
|
||||
result += b'\n' + lines[-2]
|
||||
return result
|
||||
|
||||
def create_cert(self, cert_pem):
|
||||
@@ -43,6 +43,10 @@ class NsxLibTrustManagement(utils.NsxLibApiBase):
|
||||
# should be only one result
|
||||
return results[0]['id']
|
||||
|
||||
def get_cert(self, cert_id):
|
||||
resource = CERT_SECTION + '/' + cert_id
|
||||
return self.client.get(resource)
|
||||
|
||||
def delete_cert(self, cert_id):
|
||||
resource = CERT_SECTION + '/' + cert_id
|
||||
self.client.delete(resource)
|
||||
|
||||
Reference in New Issue
Block a user