From 0690aa3d48966a4b151a468fd3a0a65bb99de439 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 15 May 2016 20:49:18 -0400 Subject: Add hal_rpc_pkey_rename(); allow null string as (temporary) key name. Temporary nature of null string as key name is not enforced by the keystore code, it's just a convention to allow callers to generate a keypair, obtain the public key, hash that to a Subject Key Identifier (SKI), and rename the key using the SKI as the new name. This is a compromise to let us use SKI-based key names in PKCS #11 while keeping the keystore code simple. --- hal_internal.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'hal_internal.h') diff --git a/hal_internal.h b/hal_internal.h index c460ed8..4b572eb 100644 --- a/hal_internal.h +++ b/hal_internal.h @@ -178,6 +178,9 @@ typedef struct { hal_error_t (*delete)(const hal_pkey_handle_t pkey); + hal_error_t (*rename)(const hal_pkey_handle_t pkey, + const uint8_t * const name, const size_t name_len); + hal_error_t (*get_key_type)(const hal_pkey_handle_t pkey, hal_key_type_t *key_type); @@ -337,6 +340,11 @@ extern hal_error_t hal_ks_delete(const hal_key_type_t type, const uint8_t * const name, const size_t name_len, int *hint); +extern hal_error_t hal_ks_rename(const hal_key_type_t type, + const uint8_t * const old_name, const size_t old_name_len, + const uint8_t * const new_name, const size_t new_name_len, + int *hint); + extern hal_error_t hal_ks_list(hal_pkey_info_t *result, unsigned *result_len, const unsigned result_max); @@ -396,6 +404,7 @@ typedef enum { RPC_FUNC_PKEY_REMOTE_SIGN, RPC_FUNC_PKEY_REMOTE_VERIFY, RPC_FUNC_PKEY_LIST, + RPC_FUNC_PKEY_RENAME, } rpc_func_num_t; #define RPC_VERSION 0x00010000 /* 0.1.0.0 */ -- cgit v1.2.3