mirror of
https://github.com/openkmip/pykmip
synced 2025-12-18 01:03:49 +00:00
Update the CreateKeyPair payloads
This change updates the CreateKeyPair payloads to the current payload format, adding properties for different payload attributes and adding comparison and string operators. Changes are also made to the PyKMIP clients and the surrounding testing infrastructure to reflect the payload changes. The official unit test suite for the CreateKeyPair payloads has been updated to also reflect these changes. This change prepares the CreateKeyPair payloads for future updates to support KMIP 2.0.
This commit is contained in:
committed by
Peter Hamilton
parent
fe3095c22b
commit
71d508019a
@@ -30,9 +30,7 @@ from kmip.core.factories.credentials import CredentialFactory
|
||||
from kmip.core.attributes import Name
|
||||
from kmip.core.attributes import CryptographicUsageMask
|
||||
|
||||
from kmip.core.objects import CommonTemplateAttribute
|
||||
from kmip.core.objects import PrivateKeyTemplateAttribute
|
||||
from kmip.core.objects import PublicKeyTemplateAttribute
|
||||
from kmip.core.objects import TemplateAttribute
|
||||
from kmip.core.objects import Attribute
|
||||
|
||||
from kmip.services.kmip_client import KMIPProxy
|
||||
@@ -117,14 +115,25 @@ if __name__ == '__main__':
|
||||
)
|
||||
attributes.append(opn)
|
||||
|
||||
common = CommonTemplateAttribute(attributes=attributes)
|
||||
private = PrivateKeyTemplateAttribute(attributes=attributes)
|
||||
public = PublicKeyTemplateAttribute(attributes=attributes)
|
||||
common = TemplateAttribute(
|
||||
attributes=attributes,
|
||||
tag=enums.Tags.COMMON_TEMPLATE_ATTRIBUTE
|
||||
)
|
||||
private = TemplateAttribute(
|
||||
attributes=attributes,
|
||||
tag=enums.Tags.PRIVATE_KEY_TEMPLATE_ATTRIBUTE
|
||||
)
|
||||
public = TemplateAttribute(
|
||||
attributes=attributes,
|
||||
tag=enums.Tags.PUBLIC_KEY_TEMPLATE_ATTRIBUTE
|
||||
)
|
||||
|
||||
# Create the SYMMETRIC_KEY object
|
||||
result = client.create_key_pair(common_template_attribute=common,
|
||||
private_key_template_attribute=private,
|
||||
public_key_template_attribute=public)
|
||||
result = client.create_key_pair(
|
||||
common_template_attribute=common,
|
||||
private_key_template_attribute=private,
|
||||
public_key_template_attribute=public
|
||||
)
|
||||
client.close()
|
||||
|
||||
# Display operation results
|
||||
|
||||
Reference in New Issue
Block a user