aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2017-03-06 17:15:55 -0500
committerRob Austein <sra@hactrn.net>2017-03-06 17:15:55 -0500
commitbcb43f6d1662d27e0a74b9705ad0d559fe4164e1 (patch)
tree8b6327fbc14f44d5dc4af67ebcd82d7361157b1d
parent67b94e0e2928fc55c4ff63073cd7e65e59938a42 (diff)
Support setting attributes via keyword arguments.
-rw-r--r--libhal.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/libhal.py b/libhal.py
index 3063398..53e5fe8 100644
--- a/libhal.py
+++ b/libhal.py
@@ -391,8 +391,9 @@ class PKey(Handle):
def verify(self, hash = 0, data = "", signature = None):
self.hsm.pkey_verify(self, hash = hash, data = data, signature = signature)
- def set_attributes(self, attributes):
- self.hsm.pkey_set_attributes(self, attributes)
+ def set_attributes(self, attributes = None, **kwargs):
+ assert if attributes is None or not kwargs
+ self.hsm.pkey_set_attributes(self, attributes or kwargs)
def get_attributes(self, attributes):
attrs = self.hsm.pkey_get_attributes(self, attributes, 0)