mirror of
https://github.com/openkmip/pykmip
synced 2025-12-22 19:23:27 +00:00
Add Encrypt support to the clients
This change adds Encrypt operation support to the KMIPProxy and ProxyKmipClient clients, including unit tests to cover the new functionality. Extensive documentation has been added to the header comments for the new client methods detailing the expected input parameters and return values. This approach should be followed for all new client additions going forward.
This commit is contained in:
@@ -59,6 +59,18 @@ class DummyKmipClient(api.KmipClient):
|
||||
def destroy(self, uid):
|
||||
super(DummyKmipClient, self).destroy(uid)
|
||||
|
||||
def encrypt(self,
|
||||
data,
|
||||
uid=None,
|
||||
cryptographic_parameters=None,
|
||||
iv_counter_nonce=None):
|
||||
super(DummyKmipClient, self).encrypt(
|
||||
data,
|
||||
uid,
|
||||
cryptographic_parameters,
|
||||
iv_counter_nonce
|
||||
)
|
||||
|
||||
def mac(self, data, uid, algorithm):
|
||||
super(DummyKmipClient, self).mac(data, uid, algorithm)
|
||||
|
||||
@@ -147,6 +159,14 @@ class TestKmipClient(testtools.TestCase):
|
||||
dummy = DummyKmipClient()
|
||||
dummy.destroy('uid')
|
||||
|
||||
def test_encrypt(self):
|
||||
"""
|
||||
Test that the encrypt method can be called without error.
|
||||
:return:
|
||||
"""
|
||||
dummy = DummyKmipClient()
|
||||
dummy.encrypt('data', 'uid', 'crypto_params', 'iv')
|
||||
|
||||
def test_mac(self):
|
||||
"""
|
||||
Test that the mac method can be called without error.
|
||||
|
||||
Reference in New Issue
Block a user