From 4fd9d1186efed0de8e3ae1d1e2fa5a0e5c46c2fb Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Mon, 2 Dec 2019 15:38:58 -0500 Subject: After some thought, I'd rather make raw export/import a sub-function of key export/import (kekek = none, kek_len = 0), rather than separate RPCs. --- cryptech/libhal.py | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'cryptech') diff --git a/cryptech/libhal.py b/cryptech/libhal.py index 1899102..647dbd6 100644 --- a/cryptech/libhal.py +++ b/cryptech/libhal.py @@ -191,8 +191,6 @@ RPCFunc.define(''' RPC_FUNC_PKEY_EXPORT, RPC_FUNC_PKEY_IMPORT, RPC_FUNC_PKEY_GENERATE_HASHSIG, - RPC_FUNC_PKEY_EXPORT_RAW, - RPC_FUNC_PKEY_IMPORT_RAW, ''') class HALDigestAlgorithm(Enum): pass @@ -436,12 +434,6 @@ class PKey(Handle): def import_pkey(self, pkcs8, kek, flags = 0): return self.hsm.pkey_import(kekek = self, pkcs8 = pkcs8, kek = kek, flags = flags) - def export_raw_pkey(self, pkey): - return self.hsm.pkey_export_raw(pkey = pkey, der_max = 5480) - - def import_raw_pkey(self, der, flags = 0): - return self.hsm.pkey_import_raw(der = der, flags = flags) - class ContextManagedUnpacker(xdrlib.Unpacker): def __enter__(self): @@ -718,15 +710,3 @@ class HSM(object): pkey = PKey(self, r.unpack_uint(), UUID(bytes = r.unpack_bytes())) logger.debug("Imported pkey %s", pkey.uuid) return pkey - - def pkey_export_raw(self, pkey, der_max = 2560): - with self.rpc(RPC_FUNC_PKEY_EXPORT_RAW, pkey, der_max) as r: - der = r.unpack_bytes(), r.unpack_bytes() - logger.debug("Exported raw pkey %s", pkey.uuid) - return der - - def pkey_import_raw(self, der, flags = 0, client = 0, session = 0): - with self.rpc(RPC_FUNC_PKEY_IMPORT_RAW, session, der, flags, client = client) as r: - pkey = PKey(self, r.unpack_uint(), UUID(bytes = r.unpack_bytes())) - logger.debug("Imported raw pkey %s", pkey.uuid) - return pkey -- cgit v1.2.3