mirror of
https://github.com/openkmip/pykmip
synced 2025-12-15 15:53:36 +00:00
Adding support for Digest
This change adds support for the Digest attribute, including updates and unit test suites for all dependent KMIP objects.
This commit is contained in:
@@ -31,11 +31,12 @@ from kmip.core.factories.keys import KeyFactory
|
||||
from kmip.core.factories.secrets import SecretFactory
|
||||
from kmip.core.keys import RawKey
|
||||
|
||||
from kmip.core.messages.contents import KeyFormatType
|
||||
from kmip.core.messages.contents import ResultStatus
|
||||
from kmip.core.messages.contents import ResultReason
|
||||
from kmip.core.messages.contents import ResultMessage
|
||||
|
||||
from kmip.core.misc import KeyFormatType
|
||||
|
||||
from kmip.core.objects import KeyBlock
|
||||
from kmip.core.objects import KeyValue
|
||||
from kmip.core.objects import KeyValueStruct
|
||||
@@ -344,7 +345,7 @@ class KMIPImpl(KMIP):
|
||||
return OperationResult(status, reason, message)
|
||||
|
||||
def _gen_symmetric_key(self, bit_length, crypto_alg):
|
||||
key_format_type = KeyBlock.KeyFormatType(KeyFormatTypeEnum.RAW)
|
||||
key_format_type = KeyFormatType(KeyFormatTypeEnum.RAW)
|
||||
key_material = RawKey(bytearray(os.urandom(int(bit_length/8))))
|
||||
key_value = KeyValueStruct(key_format_type, key_material)
|
||||
crypto_length = CryptographicLength(bit_length)
|
||||
|
||||
Reference in New Issue
Block a user