2
0
mirror of https://github.com/openkmip/pykmip synced 2026-01-06 10:33:35 +00:00

Adding support for the Certificate managed object

This change polishes and reorganizes the implementation of the
Certificate managed object and its required subclasses. It adds in
documentation and test suites for all modified classes and updates the
SecretFactory to support creating default Certificate objects.
This commit is contained in:
Peter Hamilton
2015-05-05 14:55:34 -04:00
parent 883a36f22a
commit 195671d4bf
10 changed files with 607 additions and 31 deletions

View File

@@ -28,6 +28,7 @@ from kmip.core.objects import KeyMaterial
from kmip.core.objects import KeyWrappingData
from kmip.core.objects import KeyValue
from kmip.core.secrets import Certificate
from kmip.core.secrets import OpaqueObject
from kmip.core.secrets import PrivateKey
from kmip.core.secrets import PublicKey
@@ -68,7 +69,7 @@ class SecretFactory(object):
SymmetricKey(...)
"""
if secret_type is ObjectType.CERTIFICATE:
return self._create_certificate(value)
return self._create_certificate()
elif secret_type is ObjectType.SYMMETRIC_KEY:
return self._create_symmetric_key(value)
elif secret_type is ObjectType.PUBLIC_KEY:
@@ -87,8 +88,8 @@ class SecretFactory(object):
raise TypeError("Unrecognized secret type: {0}".format(
secret_type))
def _create_certificate(self, value):
raise NotImplementedError()
def _create_certificate(self):
return Certificate()
def _create_symmetric_key(self, value):
if value is None: