Sharing an EKMF Web key with another system

A key that is generated in EKMF Web can be reused on other Linux instances. This sharing is useful for backup, recovery, and cloning setups.

Before you begin

The Linux instance that you want to share the key with, or reuse the key on, must be connected to the same EKMF Web instance as the original Linux instance from which the key was generated, see Connecting zkey with EKMF Web.
You need to know the label of the identity key of the second Linux instance. To find out what the label is, on that Linux instance issue the command zkey kms info, for example:
# zkey kms info
KMS-Plugin:             EKMFWeb
  ...
  Identity key:         ECC (secp521r1)
  Registered key label: ZKEY.ID.EC.00025
The identity key label is the last entry in the list of information.

About this task

A key can be imported to other Linux instances. Use this capability when you set up backup or recovery systems. System-specific properties, such as the volume, might need to be changed on the imported key.

Figure 1. A key can be reused on another Linux instance

The graphic is described in the text before it.
The imported key is protected by a transport key when it is sent to the second Linux instance, and then reencrypted with the master key of the AP queues the second instance uses.

Procedure

  1. The EKMF Web administrator must allow the keys to be exported from EKMF Web.
    1. On EKMF Web, go to Key management on the left navigation bar.
    2. Go to Keys
    3. Select the keys for which to edit export control.
      For example, assume you want to export XTS keys ZKEY.XTS.1.0030 and ZKEY.XTS.2.0030 that were generated by the Linux instance with the identity key ZKEY.ID.ECC.0022 to the Linux instance with the identity key ZKEY.ID.ECC.0025. Select the keys as shown in Figure 2.
      Figure 2. Select the keys for which you want to change export control

      A screenshot of the EKMF Web Edit export control window with a table of keys and their state, creation date, etc.
    4. Select Edit export control.
    5. On the Export control page, click Add key.
    6. In the field that opens, type the name of identity key you want to work with
      For example, assuming you want to export the keys to the Linux instance with the identity key ZKEY.ID.ECC.0025, as shown in Figure 3.
      Figure 3. Add the identity key of the Linux instance on which you want to reuse the keys

      A screenshot of the EKMF Web Edit export control window with an entry field open, into which you can type a key name.
    7. Click Save
    In the example shown in Figure 4, the Linux instance with the identity key ZKEY.ID.ECC.0025 can now import the XTS keys.
    Figure 4. The identity key of the Linux instance on which you want to reuse the keys is added

    A screenshot of the EKMF Web Edit export control window with an additional column holding the new key name.
  2. Optional: On the second Linux instance, check that the keys you want to use are available for importing.
    To check that the key you wanted to import is available, use the zkey kms list command.
    For example, the XTS keys the EKMF Web administrator allowed export for now show up in the list:
    # zkey kms list
    Name                         : emkf-dasdb1
    -------------------------------------------------------------------------------------
            Key label            : ZKEY.XTS1.0030
                                   ZKEY.XTS2.0030
            Description          : XTS key for DASD B1
            Key size             : 512 bits
            XTS type key         : Yes
            Key type             : CCA-AESCIPHER
            Volumes              : /dev/dasdb1:enc_disk
            Volume type          : LUKS2
            Sector size          : (system default)
            Addl. infos          : State: ACTIVE
                                   Exporting keys: ZKEY.ID.EC.00022
                                                   ZKEY.ID.EC.00025
    
    The keys you want to import must be in the ACTIVE state.
  3. On the second Linux instance, use zkey to import the keys that you want to use. Issue the zkey kms import command and specify the key label.
    For example, to import the keys with labels starting with ZKEY.XTS, issue a command as follows:
    # zkey kms import -B "ZKEY.XTS*"
    You can filter the list of keys to import, by specifying the -N (name), -B (label), -l (volume), and -t (type) options with the import command.
    For example, to import the key named emkf-dasdb1 of type LUKS2:
    # zkey kms import --name emkf-dasdb1 -t LUKS2 
  4. Change system-specific properties.
    The volume and the name are system-specific and might have to be changed. AP queues are bound to the key management system, and are set automatically.
    If needed, change the volume with the zkey change command, for example:
    # zkey change --name emkf-dasdb1 \
    -l /dev/mapper/disk2:enc-disk2 
    To change the key name, use the zkey kms rename command, see Renaming a key.

Results

You can now use the XTS keys on the second Linux instance.