aboutsummaryrefslogtreecommitdiff
path: root/libhal.py
diff options
context:
space:
mode:
Diffstat (limited to 'libhal.py')
-rw-r--r--libhal.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/libhal.py b/libhal.py
index 745c761..fbf86ff 100644
--- a/libhal.py
+++ b/libhal.py
@@ -182,6 +182,7 @@ RPCFunc.define('''
RPC_FUNC_PKEY_SET_ATTRIBUTE,
RPC_FUNC_PKEY_GET_ATTRIBUTE,
RPC_FUNC_PKEY_DELETE_ATTRIBUTE,
+ RPC_FUNC_PKEY_GET_KEY_CURVE,
''')
class HALDigestAlgorithm(Enum): pass
@@ -368,6 +369,10 @@ class PKey(Handle):
return self.hsm.pkey_get_key_type(self)
@cached_property
+ def key_curve(self):
+ return self.hsm.pkey_get_key_curve(self)
+
+ @cached_property
def key_flags(self):
return self.hsm.pkey_get_key_flags(self)
@@ -599,6 +604,10 @@ class HSM(object):
with self.rpc(RPC_FUNC_PKEY_GET_KEY_TYPE, pkey) as r:
return HALKeyType.index[r.unpack_uint()]
+ def pkey_get_key_curve(self, pkey):
+ with self.rpc(RPC_FUNC_PKEY_GET_KEY_CURVE, pkey) as r:
+ return HALCurve.index[r.unpack_uint()]
+
def pkey_get_key_flags(self, pkey):
with self.rpc(RPC_FUNC_PKEY_GET_KEY_FLAGS, pkey) as r:
return r.unpack_uint()