diff options
author | Paul Selkirk <paul@psgd.org> | 2019-12-02 15:38:58 -0500 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2019-12-02 15:38:58 -0500 |
commit | 4fd9d1186efed0de8e3ae1d1e2fa5a0e5c46c2fb (patch) | |
tree | 6ca093d7ca03ab8f179d23dc7fa9b001e377de65 /cryptech | |
parent | 323bc8ade3eae73174961bbf604257a1b099fe55 (diff) |
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.
Diffstat (limited to 'cryptech')
-rw-r--r-- | cryptech/libhal.py | 20 |
1 files changed, 0 insertions, 20 deletions
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 |