aboutsummaryrefslogtreecommitdiff
path: root/hal_internal.h
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-05-15 20:49:18 -0400
committerRob Austein <sra@hactrn.net>2016-05-15 20:49:18 -0400
commit0690aa3d48966a4b151a468fd3a0a65bb99de439 (patch)
treee88db7d7d677ea48d9bb3dbd57acc514785a44f7 /hal_internal.h
parent53b0dd22287e07ca32184c27b7ec0d75d358bde4 (diff)
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.
Diffstat (limited to 'hal_internal.h')
-rw-r--r--hal_internal.h9
1 files changed, 9 insertions, 0 deletions
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 */