diff options
author | Paul Selkirk <paul@psgd.org> | 2019-11-06 14:34:00 -0500 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2019-11-06 14:34:00 -0500 |
commit | 323bc8ade3eae73174961bbf604257a1b099fe55 (patch) | |
tree | 1559cea03677438ca9a7cb0313b65aa0cfb8f7b5 /hal_internal.h | |
parent | 9e6edd6082cc8d501e2b062983ed58b01ef677d7 (diff) |
Export/import "raw" keys for external storage.
Exported keys are wrapped with the MKM KEK, not a transit KEK, and can
only be imported back to the same HSM.
The idea is to support operators who have more keys than will fit on the
HSM, so they will cycle keys into and out of the HSM as needed.
NOTE that hashsig is, as always, special. The hashsig key has an internal
index that is updated on every signature. To prevent a hashsig key from
being re-imported with an old index (which would compromise the security
of the key), the hashsig key is disabled on export, and must be deleted
from the HSM before being re-imported.
Diffstat (limited to 'hal_internal.h')
-rw-r--r-- | hal_internal.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/hal_internal.h b/hal_internal.h index 15f4c79..1885595 100644 --- a/hal_internal.h +++ b/hal_internal.h @@ -380,6 +380,16 @@ typedef struct { const uint8_t * const kek, const size_t kek_len, const hal_key_flags_t flags); + hal_error_t (*export_raw)(const hal_pkey_handle_t pkey_handle, + uint8_t *der, size_t *der_len, const size_t der_max); + + hal_error_t (*import_raw)(const hal_client_handle_t client, + const hal_session_handle_t session, + hal_pkey_handle_t *pkey, + hal_uuid_t *name, + const uint8_t * const der, const size_t der_len, + const hal_key_flags_t flags); + } hal_rpc_pkey_dispatch_t; @@ -662,9 +672,11 @@ typedef enum { RPC_FUNC_PKEY_EXPORT, RPC_FUNC_PKEY_IMPORT, RPC_FUNC_PKEY_GENERATE_HASHSIG, + RPC_FUNC_PKEY_EXPORT_RAW, + RPC_FUNC_PKEY_IMPORT_RAW, } rpc_func_num_t; -#define RPC_VERSION 0x01010100 /* 1.1.1.0 */ +#define RPC_VERSION 0x01010200 /* 1.1.2.0 */ /* * RPC client locality. These have to be defines rather than an enum, |