How to generate & transfer HSM-protected keys – BYOK – Azure Key Vault (2024)

  • Article

For added assurance when you use Azure Key Vault, you can import or generate a key in a hardware security module (HSM); the key will never leave the HSM boundary. This scenario often is referred to as bring your own key (BYOK). Key Vault uses FIPS 140 validated HSMs to protect your keys.

Use the information in this article to help you plan for, generate, and transfer your own HSM-protected keys to use with Azure Key Vault.

Note

This functionality is not available for Microsoft Azure operated by 21Vianet.

This import method is available only for supported HSMs.

For more information, and for a tutorial to get started using Key Vault (including how to create a key vault for HSM-protected keys), see What is Azure Key Vault?.

Overview

Here's an overview of the process. Specific steps to complete are described later in the article.

  • In Key Vault, generate a key (referred to as a Key Exchange Key (KEK)). The KEK must be an RSA-HSM key that has only the import key operation. Only Key Vault Premium and Managed HSM support RSA-HSM keys.
  • Download the KEK public key as a .pem file.
  • Transfer the KEK public key to an offline computer that is connected to an on-premises HSM.
  • In the offline computer, use the BYOK tool provided by your HSM vendor to create a BYOK file.
  • The target key is encrypted with a KEK, which stays encrypted until it is transferred to the Key Vault HSM. Only the encrypted version of your key leaves the on-premises HSM.
  • A KEK that's generated inside a Key Vault HSM is not exportable. HSMs enforce the rule that no clear version of a KEK exists outside a Key Vault HSM.
  • The KEK must be in the same key vault where the target key will be imported.
  • When the BYOK file is uploaded to Key Vault, a Key Vault HSM uses the KEK private key to decrypt the target key material and import it as an HSM key. This operation happens entirely inside a Key Vault HSM. The target key always remains in the HSM protection boundary.

Prerequisites

The following table lists prerequisites for using BYOK in Azure Key Vault:

RequirementMore information
An Azure subscriptionTo create a key vault in Azure Key Vault, you need an Azure subscription. Sign up for a free trial.
A Key Vault Premium or Managed HSM to import HSM-protected keysFor more information about the service tiers and capabilities in Azure Key Vault, see Key Vault Pricing.
An HSM from the supported HSMs list and a BYOK tool and instructions provided by your HSM vendorYou must have permissions for an HSM and basic knowledge of how to use your HSM. See Supported HSMs.
Azure CLI version 2.1.0 or laterSee Install the Azure CLI.

Supported HSMs

Vendor nameVendor TypeSupported HSM modelsMore information
CryptomathicISV (Enterprise Key Management System)Multiple HSM brands and models including
  • nCipher
  • Thales
  • Utimaco
See Cryptomathic site for details
EntrustManufacturer,
HSM as a service
  • nShield family of HSMs
  • nShield as a service
nCipher new BYOK tool and documentation
FortanixManufacturer,
HSM as a service
  • Self-Defending Key Management Service (SDKMS)
  • Equinix SmartKey
Exporting SDKMS keys to Cloud Providers for BYOK - Azure Key Vault
IBMManufacturerIBM 476x, CryptoExpressIBM Enterprise Key Management Foundation
MarvellManufacturerAll LiquidSecurity HSMs with
  • Firmware version 2.0.4 or later
  • Firmware version 3.2 or newer
Marvell BYOK tool and documentation
nCipherManufacturer,
HSM as a service
  • nShield family of HSMs
  • nShield as a service
nCipher new BYOK tool and documentation
Securosys SAManufacturer,
HSM as a service
Primus HSM family, Securosys Clouds HSMPrimus BYOK tool and documentation
StorMagicISV (Enterprise Key Management System)Multiple HSM brands and models including
  • Utimaco
  • Thales
  • nCipher
See StorMagic site for details
SvKMS and Azure Key Vault BYOK
ThalesManufacturer
  • Luna HSM 7 family with firmware version 7.3 or newer
Luna BYOK tool and documentation
UtimacoManufacturer,
HSM as a service
u.trust Anchor, CryptoServerUtimaco BYOK tool and Integration guide

Supported key types

Key nameKey typeKey size/curveOriginDescription
Key Exchange Key (KEK)RSA2,048-bit
3,072-bit
4,096-bit
Azure Key Vault HSMAn HSM-backed RSA key pair generated in Azure Key Vault
Target key
RSA2,048-bit
3,072-bit
4,096-bit
Vendor HSMThe key to be transferred to the Azure Key Vault HSM
ECP-256
P-384
P-521
Vendor HSMThe key to be transferred to the Azure Key Vault HSM

Generate and transfer your key to Key Vault Premium HSM or Managed HSM

To generate and transfer your key to a Key Vault Premium or Managed HSM:

  • Step 1: Generate a KEK
  • Step 2: Download the KEK public key
  • Step 3: Generate and prepare your key for transfer
  • Step 4: Transfer your key to Azure Key Vault

Generate a KEK

A KEK is an RSA key that's generated in a Key Vault Premium or Managed HSM. The KEK is used to encrypt the key you want to import (the target key).

The KEK must be:

  • An RSA-HSM key (2,048-bit; 3,072-bit; or 4,096-bit)
  • Generated in the same key vault where you intend to import the target key
  • Created with allowed key operations set to import

Note

The KEK must have 'import' as the only allowed key operation. 'import' is mutually exclusive with all other key operations.

Use the 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.)

  • Azure CLI
  • Azure PowerShell
az keyvault key create --kty RSA-HSM --size 4096 --name KEKforBYOK --ops import --vault-name ContosoKeyVaultHSM

For Managed HSM:

az keyvault key create --kty RSA-HSM --size 4096 --name KEKforBYOK --ops import --hsm-name ContosoKeyVaultHSM

Download the KEK public key

Use 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.

  • Azure CLI
  • Azure PowerShell
az keyvault key download --name KEKforBYOK --vault-name ContosoKeyVaultHSM --file KEKforBYOK.publickey.pem

For Managed HSM:

az keyvault key download --name KEKforBYOK --hsm-name ContosoKeyVaultHSM --file KEKforBYOK.publickey.pem

Transfer the KEKforBYOK.publickey.pem file to your offline computer. You will need this file in the next step.

Generate and prepare your key for transfer

Refer to your HSM vendor's documentation to download and install the BYOK tool. Follow instructions from your HSM vendor to generate a target key, and then create a key transfer package (a BYOK file). The BYOK tool will use the kid from Step 1 and the KEKforBYOK.publickey.pem file you downloaded in Step 2 to generate an encrypted target key in a BYOK file.

Transfer the BYOK file to your connected computer.

Note

Importing RSA 1,024-bit keys is not supported. Importing Elliptic Curve key with curve P-256K is supported.

Known issue: Importing an RSA 4K target key from Luna HSMs is only supported with firmware 7.4.0 or newer.

Transfer your key to Azure Key Vault

To complete the key import, transfer the key transfer package (a BYOK file) from your disconnected computer to the internet-connected computer. Use the az keyvault key import command to upload the BYOK file to the Key Vault HSM.

To import an RSA key use following command. Parameter --kty is optional and defaults to 'RSA-HSM'.

  • Azure CLI
  • Azure PowerShell
az keyvault key import --vault-name ContosoKeyVaultHSM --name ContosoFirstHSMkey --byok-file KeyTransferPackage-ContosoFirstHSMkey.byok

For Managed HSM

az keyvault key import --hsm-name ContosoKeyVaultHSM --name ContosoFirstHSMkey --byok-file KeyTransferPackage-ContosoFirstHSMkey.byok

To import an EC key, you must specify key type and the curve name.

  • Azure CLI
  • Azure PowerShell
az keyvault key import --vault-name ContosoKeyVaultHSM --name ContosoFirstHSMkey --kty EC-HSM --curve-name "P-256" --byok-file KeyTransferPackage-ContosoFirstHSMkey.byok

For Managed HSM

az keyvault key import --hsm-name ContosoKeyVaultHSM --name ContosoFirstHSMkey --byok-file --kty EC-HSM --curve-name "P-256" KeyTransferPackage-ContosoFirstHSMkey.byok

If the upload is successful, Azure CLI displays the properties of the imported key.

Next steps

You can now use this HSM-protected key in your key vault. For more information, see this price and feature comparison.

How to generate & transfer HSM-protected keys – BYOK – Azure Key Vault (2024)
Top Articles
The 5 books that helped this millennial pay off $29,000 in debt and save $100,000
Cost of living in the Netherlands – single, family & student
Kathleen Hixson Leaked
4-Hour Private ATV Riding Experience in Adirondacks 2024 on Cool Destinations
Limp Home Mode Maximum Derate
Kraziithegreat
Rabbits Foot Osrs
Top Financial Advisors in the U.S.
World Cup Soccer Wiki
R/Altfeet
Sand Castle Parents Guide
ᐅ Bosch Aero Twin A 863 S Scheibenwischer
Lonesome Valley Barber
Unforeseen Drama: The Tower of Terror’s Mysterious Closure at Walt Disney World
Hewn New Bedford
Buying Cars from Craigslist: Tips for a Safe and Smart Purchase
Prey For The Devil Showtimes Near Ontario Luxe Reel Theatre
Https E22 Ultipro Com Login Aspx
Page 2383 – Christianity Today
Abga Gestation Calculator
Penn State Service Management
Rs3 Bring Leela To The Tomb
Why comparing against exchange rates from Google is wrong
Jeep Cherokee For Sale By Owner Craigslist
Wbli Playlist
Σινεμά - Τι Ταινίες Παίζουν οι Κινηματογράφοι Σήμερα - Πρόγραμμα 2024 | iathens.gr
Audi Q3 | 2023 - 2024 | De Waal Autogroep
Navigating change - the workplace of tomorrow - key takeaways
Craigslist Albany Ny Garage Sales
Pillowtalk Podcast Interview Turns Into 3Some
Culvers Lyons Flavor Of The Day
The Minneapolis Journal from Minneapolis, Minnesota
Froedtert Billing Phone Number
10 Rarest and Most Valuable Milk Glass Pieces: Value Guide
Noaa Duluth Mn
Carroll White Remc Outage Map
Atom Tickets – Buy Movie Tickets, Invite Friends, Skip Lines
National Weather Service Richmond Va
Sea Guini Dress Code
Sandra Sancc
The Complete Uber Eats Delivery Driver Guide:
Erespassrider Ual
300+ Unique Hair Salon Names 2024
Join MileSplit to get access to the latest news, films, and events!
Barback Salary in 2024: Comprehensive Guide | OysterLink
San Diego Padres Box Scores
Greg Steube Height
Unpleasant Realities Nyt
De Donde Es El Area +63
Worlds Hardest Game Tyrone
Unity Webgl Extreme Race
Dinargurus
Latest Posts
Article information

Author: Msgr. Benton Quitzon

Last Updated:

Views: 6090

Rating: 4.2 / 5 (63 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Msgr. Benton Quitzon

Birthday: 2001-08-13

Address: 96487 Kris Cliff, Teresiafurt, WI 95201

Phone: +9418513585781

Job: Senior Designer

Hobby: Calligraphy, Rowing, Vacation, Geocaching, Web surfing, Electronics, Electronics

Introduction: My name is Msgr. Benton Quitzon, I am a comfortable, charming, thankful, happy, adventurous, handsome, precious person who loves writing and wants to share my knowledge and understanding with you.