@@ -67,7 +67,6 @@ The following table lists prerequisites for using BYOK in Azure Key Vault:
67
67
| Utimaco| Manufacturer,<br />HSM as a service| u.trust Anchor, CryptoServer| Utimaco BYOK tool and Integration guide |
68
68
||||
69
69
70
-
71
70
## Supported key types
72
71
73
72
| Key name| Key type| Key size/curve| Origin| Description|
@@ -101,51 +100,62 @@ The KEK must be:
101
100
102
101
Use the [ az keyvault key create] ( /cli/azure/keyvault/key#az-keyvault-key-create ) command to create a KEK that has key operations set to ` import ` . Record the key identifier (` kid ` ) that's returned from the following command. (You will use the ` kid ` value in [ Step 3] ( #generate-and-prepare-your-key-for-transfer ) .)
103
102
103
+ ### [ Azure CLI] ( #tab/azure-cli )
104
+
104
105
``` azurecli
105
106
az keyvault key create --kty RSA-HSM --size 4096 --name KEKforBYOK --ops import --vault-name ContosoKeyVaultHSM
106
107
```
107
- or in PowerShell
108
108
109
- ``` azurepowershell
110
- Add-AzKeyVaultKey -VaultName 'ContosoKeyVaultHSM' -Name 'KEKforBYOK' -Destination 'HSM' -Size 4096 -KeyOps 'import'
111
- ```
112
-
113
- or for Managed HSM
109
+ For Managed HSM:
114
110
115
111
``` azurecli
116
112
az keyvault key create --kty RSA-HSM --size 4096 --name KEKforBYOK --ops import --hsm-name ContosoKeyVaultHSM
117
113
```
118
- or in PowerShell for Managed HSM
114
+
115
+ ### [ Azure PowerShell] ( #tab/azure-powershell )
116
+
117
+ ``` azurepowershell
118
+ Add-AzKeyVaultKey -VaultName 'ContosoKeyVaultHSM' -Name 'KEKforBYOK' -Destination 'HSM' -Size 4096 -KeyOps 'import'
119
+ ```
120
+
121
+ For Managed HSM:
119
122
120
123
``` azurepowershell
121
124
Add-AzKeyVaultKey -HsmName 'ContosoKeyVaultHSM' -Name 'KEKforBYOK' -Destination 'HSM' -Size 4096 -KeyOps 'import'
122
125
```
123
126
127
+ ---
128
+
124
129
### Download the KEK public key
125
130
126
131
Use [ az keyvault key download] ( /cli/azure/keyvault/key#az-keyvault-key-download ) to download the KEK public key to a .pem file. The target key you import is encrypted by using the KEK public key.
127
132
133
+ ### [ Azure CLI] ( #tab/azure-cli )
134
+
128
135
``` azurecli
129
136
az keyvault key download --name KEKforBYOK --vault-name ContosoKeyVaultHSM --file KEKforBYOK.publickey.pem
130
137
```
131
- or in PowerShell
132
-
133
- ``` azurepowershell
134
- Get-AzKeyVaultKey -VaultName 'ContosoKeyVaultHSM' -KeyName 'KEKforBYOK' -OutFile 'KEKforBYOK.publickey.pem'
135
- ```
136
138
137
- or for Managed HSM
139
+ For Managed HSM:
138
140
139
141
``` azurecli
140
142
az keyvault key download --name KEKforBYOK --hsm-name ContosoKeyVaultHSM --file KEKforBYOK.publickey.pem
141
143
```
142
144
143
- or in PowerShell for Managed HSM
145
+ ### [ Azure PowerShell] ( #tab/azure-powershell )
146
+
147
+ ``` azurepowershell
148
+ Get-AzKeyVaultKey -VaultName 'ContosoKeyVaultHSM' -KeyName 'KEKforBYOK' -OutFile 'KEKforBYOK.publickey.pem'
149
+ ```
150
+
151
+ For Managed HSM
144
152
145
153
``` azurepowershell
146
154
Get-AzKeyVaultKey -HsmName 'ContosoKeyVaultHSM' -KeyName 'KEKforBYOK' -OutFile 'KEKforBYOK.publickey.pem'
147
155
```
148
156
157
+ ---
158
+
149
159
Transfer the KEKforBYOK.publickey.pem file to your offline computer. You will need this file in the next step.
150
160
151
161
### Generate and prepare your key for transfer
@@ -154,9 +164,9 @@ Refer to your HSM vendor's documentation to download and install the BYOK tool.
154
164
155
165
Transfer the BYOK file to your connected computer.
156
166
157
- > [ !NOTE]
167
+ > [ !NOTE]
158
168
> Importing RSA 1,024-bit keys is not supported. Importing Elliptic Curve key with curve P-256K is not supported.
159
- >
169
+ >
160
170
> ** Known issue** : Importing an RSA 4K target key from Luna HSMs is only supported with firmware 7.4.0 or newer.
161
171
162
172
### Transfer your key to Azure Key Vault
@@ -165,51 +175,59 @@ To complete the key import, transfer the key transfer package (a BYOK file) from
165
175
166
176
To import an RSA key use following command. Parameter --kty is optional and defaults to 'RSA-HSM'.
167
177
178
+ ### [ Azure CLI] ( #tab/azure-cli )
179
+
168
180
``` azurecli
169
181
az keyvault key import --vault-name ContosoKeyVaultHSM --name ContosoFirstHSMkey --byok-file KeyTransferPackage-ContosoFirstHSMkey.byok
170
182
```
171
183
172
- or in PowerShell
184
+ For Managed HSM
173
185
174
- ``` azurepowershell
175
- Add-AzKeyVaultKey -VaultName ' ContosoKeyVaultHSM' -KeyName ' ContosoFirstHSMkey' -KeyFilePath ' KeyTransferPackage-ContosoFirstHSMkey.byok'
186
+ ``` azurecli
187
+ az keyvault key import --hsm-name ContosoKeyVaultHSM --name ContosoFirstHSMkey --byok-file KeyTransferPackage-ContosoFirstHSMkey.byok
176
188
```
177
189
178
- or for Managed HSM
190
+ ### [ Azure PowerShell ] ( #tab/azure-powershell )
179
191
180
- ``` azurecli
181
- az keyvault key import --hsm-name ContosoKeyVaultHSM --name ContosoFirstHSMkey --byok-file KeyTransferPackage-ContosoFirstHSMkey.byok
192
+ ``` azurepowershell
193
+ Add-AzKeyVaultKey -VaultName ' ContosoKeyVaultHSM' -KeyName ' ContosoFirstHSMkey' -KeyFilePath ' KeyTransferPackage-ContosoFirstHSMkey.byok'
182
194
```
183
- or in PowerShell for Managed HSM
195
+ For Managed HSM
184
196
185
197
``` azurepowershell
186
198
Add-AzKeyVaultKey -HsmName 'ContosoKeyVaultHSM' -KeyName 'ContosoFirstHSMkey' -KeyFilePath 'KeyTransferPackage-ContosoFirstHSMkey.byok'
187
199
```
188
200
201
+ ---
202
+
189
203
To import an EC key, you must specify key type and the curve name.
190
204
205
+ ### [ Azure CLI] ( #tab/azure-cli )
206
+
191
207
``` azurecli
192
208
az keyvault key import --vault-name ContosoKeyVaultHSM --name ContosoFirstHSMkey --kty EC-HSM --curve-name "P-256" --byok-file KeyTransferPackage-ContosoFirstHSMkey.byok
193
209
```
194
210
195
- or in PowerShell
211
+ For Managed HSM
196
212
197
- ``` azurepowershell
198
- Add-AzKeyVaultKey -VaultName ' ContosoKeyVaultHSM' -KeyName ' ContosoFirstHSMkey' -KeyType EC -CurveName P-256 -KeyFilePath ' KeyTransferPackage-ContosoFirstHSMkey.byok'
213
+ ``` azurecli
214
+ az keyvault key import --hsm-name ContosoKeyVaultHSM --name ContosoFirstHSMkey --byok-file --kty EC-HSM --curve-name " P-256" KeyTransferPackage-ContosoFirstHSMkey.byok
199
215
```
200
216
201
- or for Managed HSM
217
+ ### [ Azure PowerShell ] ( #tab/azure-powershell )
202
218
203
- ``` azurecli
204
- az keyvault key import --hsm-name ContosoKeyVaultHSM --name ContosoFirstHSMkey --byok-file --kty EC-HSM --curve-name " P-256" KeyTransferPackage-ContosoFirstHSMkey.byok
219
+ ``` azurepowershell
220
+ Add-AzKeyVaultKey -VaultName ' ContosoKeyVaultHSM' -KeyName ' ContosoFirstHSMkey' -KeyType EC -CurveName P-256 -KeyFilePath ' KeyTransferPackage-ContosoFirstHSMkey.byok'
205
221
```
206
222
207
- or in PowerShell for Managed HSM
223
+ For Managed HSM
208
224
209
225
``` azurepowershell
210
226
Add-AzKeyVaultKey -HsmName 'ContosoKeyVaultHSM' -KeyName 'ContosoFirstHSMkey' -KeyType EC -CurveName P-256 -KeyFilePath 'KeyTransferPackage-ContosoFirstHSMkey.byok'
211
227
```
212
228
229
+ ---
230
+
213
231
If the upload is successful, Azure CLI displays the properties of the imported key.
214
232
215
233
## Next steps
0 commit comments