mirror of
https://github.com/OpenKMIP/PyKMIP.git
synced 2025-07-20 12:34:22 +02:00
create SecretData objects with custom attributes
This commit is contained in:
parent
9403ff3d2a
commit
a9d15eb253
@ -20,6 +20,7 @@ from kmip.core import enums
|
||||
from kmip.core import primitives
|
||||
from kmip.core import objects as cobjects
|
||||
|
||||
from kmip.core.objects import Attribute
|
||||
from kmip.core.factories import attributes
|
||||
|
||||
from kmip.core.attributes import CryptographicParameters
|
||||
@ -557,6 +558,11 @@ class ProxyKmipClient(object):
|
||||
)
|
||||
object_attributes.append(name_attribute)
|
||||
|
||||
if hasattr(managed_object, '_application_specific_informations'):
|
||||
if managed_object._application_specific_informations:
|
||||
for attr in managed_object._application_specific_informations:
|
||||
object_attributes.append(attr)
|
||||
|
||||
template = cobjects.TemplateAttribute(attributes=object_attributes)
|
||||
object_type = managed_object.object_type
|
||||
|
||||
|
@ -1580,7 +1580,7 @@ class SecretData(CryptographicObject):
|
||||
'sqlite_autoincrement': True
|
||||
}
|
||||
|
||||
def __init__(self, value, data_type, masks=None, name='Secret Data'):
|
||||
def __init__(self, value, data_type, app_specific_info=None, masks=None, name='Secret Data'):
|
||||
"""
|
||||
Create a SecretData object.
|
||||
|
||||
@ -1600,6 +1600,9 @@ class SecretData(CryptographicObject):
|
||||
self.data_type = data_type
|
||||
self.names = [name]
|
||||
|
||||
if app_specific_info:
|
||||
self._application_specific_informations = app_specific_info
|
||||
|
||||
if masks:
|
||||
self.cryptographic_usage_masks = masks
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user