Device and method with controlled use of keys in key slots of hardware security module (HSM) key vault
A device and corresponding method control use of keys in key slots of a Hardware Security Module (HSM) key vault. The device comprises the HSM key vault and a HSM. The HSM stores a key for use in a cryptographic operation and slot key-information of the key in a key slot of the key slots. The slot key-information includes a key type of the key. The key slots are available for storing the key irrespective of the key type. The key type is associated with the cryptographic operation. The HSM controls use of the key based on a decision to grant or deny a request that includes request key-information and a slot identifier of the key slot. The HSM locates the key slot via the slot identifier, makes the decision based on the request key-information and slot key-information, and outputs a response to the request that indicates the decision made.
1 . A device comprising:
a hardware security module (HSM) key vault including key slots; and
a HSM configured to store a key for use in a cryptographic operation and slot key-information of the key in a key slot of the key slots, the slot key-information including a key type, key length, and key token of the key, the key slots of the HSM key vault available for storing the key irrespective of the key type, the key type associated with the cryptographic operation,
the HSM further configured to control use of the key stored in the key slot based on a decision to grant or deny a request, the request including request key-information and a slot identifier of the key slot, the HSM further configured to locate the key slot via the slot identifier, make the decision based on a request key type, request key length, and request key token of the request key-information of the request and the key type, key length, and key token of the slot key-information stored in the key slot located, and output a response to the request, the response output indicating the decision made.
2 . The device of claim 1 , wherein direct access to the HSM key vault is exclusive to the HSM.
3 . The device of claim 1 , wherein the HSM is further configured to:
based on the decision made to grant the request, perform the cryptographic operation and configure the response output to indicate that the request was performed; and
based on the decision made to deny the request, configure the response output to indicate that the request was not performed.
4 . The device of claim 1 , wherein the key slots are arranged as an array of key slots and wherein the slot identifier is an index into the array.
5 . The device of claim 1 , wherein each key slot of the key slots of the HSM key vault is a general-purpose key slot, wherein the general-purpose key slot is a reusable key slot for storing keys of different lengths, keys of different key types, and keys for use in different cryptographic operations.
6 . The device of claim 1 , wherein the key slot includes a key length field, key type field, key data field, and key token field for storing the key length of the key, the key type of the key, the key, and the key token for the key, respectively.
7 . The device of claim 1 , wherein the key token represents a password for using the key stored in the key slot of the key slots of the HSM key vault.
8 . The device of claim 1 , wherein the request key-information includes the request key type, request key length, and request key token, and wherein the HSM is further configured to make the decision based on a result of a comparison of the key type, key length, and key token of the slot key-information to the request key type, request key length, and request key token of the request key-information, respectively.
9 . The device of claim 8 , wherein the HSM is further configured to:
make the decision to grant the request based on the result of the comparison indicating that the key type, key length, and key token of the slot key-information match the request key type, request key length, and request key token of the request key-information, respectively; and
make the decision to deny the request based on the result of the comparison indicating a mismatch.
10 . The device of claim 1 , wherein the request key-information includes the request key type, request key length, and request key token, wherein the request further includes at least one parameter, and wherein the HSM is further configured to:
make the decision to grant the request based on the key type, key length, and key token of the slot key-information matching the request key type, request key length, and request key token of the request key-information, respectively; and
perform the cryptographic operation based on the decision made to grant the request, wherein the cryptographic operation is performed using the key and the at least one parameter.
11 . The device of claim 1 , wherein the HSM is further configured to store, in an unencrypted form, the key and the slot key-information in the key slot of the HSM key vault.
12 . The device of claim 1 , wherein the request is a cryptographic-operation request and wherein the HSM is further configured to:
process a load key-set request received from an initiator, the load key-set request including key-set location information and key-set slot information, the key-set location information including location information for locating a protected version of a key set, wherein the protected version is in an encrypted form, and wherein, to process the load key-set request, the HSM is further configured to:
locate the protected version of the key set in a memory based on the location information included in the key-set location information, wherein the memory is external to the HSM;
load, from the memory, the protected version located in the memory;
use at least one cryptographic key provisioned on the HSM to unprotect the protected version loaded to produce an unprotected version of the key set, the unprotected version of the key set including, in an unencrypted form, the key, the key type, and the key length of the key;
generate a respective key token for each key included in the unprotected version of the key set, thereby generating the key token for the key;
store the unprotected version of the key set in the HSM key vault based on the key-set slot information of the load key-set request, thereby storing the key and slot key-information of the key in the key slot; and
output a load key-set response to the initiator, the load key-set response including each respective key token generated.
13 . The device of claim 12 , wherein a cryptographic key of the at least one cryptographic key is an Advanced Encryption Standard (AES)-based key, or another type of key used for decrypting data.
14 . The device of claim 1 , wherein the HSM is further configured to:
produce a protected version of a key set based on a store key-set request received from an initiator, the key set including the key, the key type, and the key length of the key stored in the key slot; and
store, in memory external to the HSM, the protected version of the key set produced.
15 . The device of claim 1 , wherein the HSM includes at least one processor and at least one memory with computer code instructions stored thereon, the at least one processor and the at least one memory, with the computer code instructions, configured to cause the HSM to store the key, control use of the key, and output the response.
16 . The device of claim 1 , wherein HSM key vault is an internal memory of the HSM, an external memory of the HSM, a set of hardware registers of the HSM, or another storage element of the HSM for which direct access is exclusive to the HSM.
17 . The device of claim 1 , wherein the device is a system-on-chip (SoC) and wherein the HSM is an embedded HSM (eHSM) of the SoC.
18 . A method comprising:
storing a key for use in a cryptographic operation and slot key-information of the key in a key slot of key slots of a hardware security module (HSM) key vault, the slot key-information including a key type, key length, and key token of the key, the key slots of the HSM key vault available for storing the key irrespective of the key type, the key type associated with the cryptographic operation;
controlling use of the key stored in the key slot based on a decision to grant or deny a request, the request including request key-information and a slot identifier of the key slot, the controlling including locating the key slot via the slot identifier and making the decision based on a request key type, request key length, and request key token of the request key-information of the request and the key type, key length, and key token of the slot key-information stored in the key slot located; and
outputting a response to the request, the response output indicating the decision made.
19 . The method of claim 18 , further comprising accessing the HSM key vault, directly, by the HSM, exclusively.
20 . The method of claim 18 , further comprising:
based on the decision made to grant the request, performing the cryptographic operation and configuring the response output to indicate that the request was performed; and
based on the decision made to deny the request, configuring the response output to indicate that the request was not performed.
21 . The method of claim 18 , wherein the key slots are arranged as an array of key slots and wherein the method further comprises using the slot identifier as an index into the array.
22 . The method of claim 18 , wherein each key slot of the key slots of the HSM key vault is a general-purpose key slot and wherein the method further comprises reusing the general-purpose key slot for storing keys of different lengths, keys of different key types, and keys for use in different cryptographic operations.
23 . The method of claim 18 , further comprising storing the key length of the key, the key type of the key, the key, and the key token for the key, in a key length field, key type field, key data field, and key token field of the key slot, respectively.
24 . The method of claim 18 , wherein the key token represents a password for using the key stored in the key slot of the key slots of the HSM key vault, wherein the request key-information includes the request key token, and wherein making the decision includes comparing the request key token of the request to the key token of the slot key-information.
25 . The method of claim 18 , wherein the request key-information includes the request key type, request key length, and request key token, and wherein the method further comprises making the decision based on a result of a comparison of the key type, key length, and key token of the slot key-information to the request key type, request key length, and request key token of the request key-information, respectively.
26 . The method of claim 25 , further comprising:
making the decision to grant the request based on the result of the comparison indicating that the key type, key length, and key token of the slot key-information match the key type, key length, and key token of the request key-information, respectively; and
making the decision to deny the request based on the result of the comparison indicating a mismatch.
27 . The method of claim 18 , wherein the request key-information includes the request key type, request key length, and request key token, wherein the request further includes at least one parameter, and wherein the method further comprises:
making the decision to grant the request based on the key type, key length, and key token of the slot key-information matching a request key type, request key length, and request key token of the request key-information, respectively; and
performing the cryptographic operation based on the decision made to grant the request, wherein performing the cryptographic operation includes using the key and the at least one parameter.
28 . The method of claim 18 , further comprising store, in an unencrypted form, the key and the slot key-information in the key slot of the HSM key vault.
29 . The method of claim 18 , wherein the request is a cryptographic-operation request and wherein the method further comprises:
processing a load key-set request received from an initiator, the load key-set request including key-set location information and key-set slot information, the key-set location information including location information for locating a protected version of a key set, wherein the protected version is in an encrypted form, and wherein processing the load key-set request includes:
locating the protected version of the key set in a memory based on the location information included in the key-set location information, wherein the memory is external to the HSM;
loading, from the memory, the protected version located in the memory;
using at least one cryptographic key provisioned on the HSM to unprotect the protected version loaded to produce an unprotected version of the key set, the unprotected version of the key set including, in an unencrypted form, the key, the key type, and the key length of the key;
generating a respective key token for each key included in the unprotected version of the key set, thereby generating the key token for the key;
storing the unprotected version of the key set in the HSM key vault based on the key-set slot information of the load key-set request, thereby storing the key and slot key-information of the key in the key slot; and
outputting a load key-set response to the initiator, the load key-set response including each respective key token generated.
30 . The method of claim 29 , wherein a cryptographic key of the at least one cryptographic key is an Advanced Encryption Standard (AES)-based key, or another type of key used for decrypting data.
31 . The method of claim 18 , further comprising:
producing a protected version of a key set based on a store key-set request received from an initiator, the key set including the key, the key type, and the key length of the key stored in the key slot; and
storing, in memory external to the HSM, the protected version of the key set produced.
32 . An apparatus comprising:
means for storing a key for use in a cryptographic operation and slot key-information of the key in a key slot of key slots of a hardware security module (HSM) key vault, the slot key-information including a key type, key length, and key token of the key, the key slots of the HSM key vault available for storing the key irrespective of the key type, the key type associated with the cryptographic operation;
means for controlling use of the key stored in the key slot based on a decision to grant or deny a request, the request including request key-information and a slot identifier of the key slot, the controlling including locating the key slot via the slot identifier and making the decision based on a request key type, request key length, and request key token of the request key-information of the request and the key type, key length, and key token of the slot key-information stored in the key slot located; and
means for outputting a response to the request, the response output indicating the decision made.