From 19a901d0beaee43b69433695ec8c36e9e2e0365b Mon Sep 17 00:00:00 2001 From: Pranathi Locula Date: Mon, 18 Oct 2021 13:26:08 -0400 Subject: [PATCH] add custom attribute support --- kmip/pie/client.py | 1 - kmip/pie/objects.py | 12 +++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/kmip/pie/client.py b/kmip/pie/client.py index c9fd721..4944cac 100644 --- a/kmip/pie/client.py +++ b/kmip/pie/client.py @@ -565,7 +565,6 @@ class ProxyKmipClient(object): template = cobjects.TemplateAttribute(attributes=object_attributes) object_type = managed_object.object_type - # Register the managed object and handle the results secret = self.object_factory.convert(managed_object) result = self.proxy.register(object_type, template, secret) diff --git a/kmip/pie/objects.py b/kmip/pie/objects.py index 1186fc9..f239a68 100644 --- a/kmip/pie/objects.py +++ b/kmip/pie/objects.py @@ -658,7 +658,7 @@ class SymmetricKey(Key): } def __init__(self, algorithm, length, value, app_specific_info=None, masks=None, - name='Symmetric Key', key_wrapping_data=None): + name='Symmetric Key2', key_wrapping_data=None): """ Create a SymmetricKey. @@ -824,7 +824,7 @@ class PublicKey(Key): def __init__(self, algorithm, length, value, format_type=enums.KeyFormatType.X_509, masks=None, - name='Public Key', key_wrapping_data=None): + name='Public Key', app_specific_info = None, key_wrapping_data=None): """ Create a PublicKey. @@ -862,6 +862,9 @@ class PublicKey(Key): if masks: self.cryptographic_usage_masks = masks + if app_specific_info: + self._application_specific_informations = app_specific_info + # All remaining attributes are not considered part of the public API # and are subject to change. @@ -989,7 +992,7 @@ class PrivateKey(Key): } def __init__(self, algorithm, length, value, format_type, masks=None, - name='Private Key', key_wrapping_data=None): + name='Private Key', app_specific_info = None, key_wrapping_data=None): """ Create a PrivateKey. @@ -1026,6 +1029,9 @@ class PrivateKey(Key): if masks: self.cryptographic_usage_masks = masks + if app_specific_info: + self._application_specific_informations = app_specific_info + # All remaining attributes are not considered part of the public API # and are subject to change.