To generate a zone-signing key (ZSK) and a key-signing key (KSK) on the HSM use the pkcs11-tool utility. After the keys are generated on HSM, use dnssec-keyfromlabel provided by BIND to generate the key files for BIND containing a public key and an identifier of the actual private key.
Two slots need to be initialized in HSM for RSA and ECC keys. The slot labels should be unique. For this integration, slot labels are 'Bind9_RSA' and 'Bind9_EC'.
Generating KSK and ZSK with RSA Algorithm
-
Run the following commands to generate a zone-signing key and a key-signing key using RSA algorithm:
|
›_ Console |
|---|
|
Key generation output for KSK -RSA
Key generation output for ZSK -RSA
Each key should have a unique label that will be used to refer to the private key in the next steps.
-
List the keys using the
p11tool2command.
|
›_ Console |
|---|
|
List key output in slot 0
Generating KSK and ZSK with ECC algorithm
-
Run the following commands to generate a zone-signing key and a key-signing key using ECC. Curve used is prime256v1.
|
›_ Console |
|---|
|
Key generation output for KSK -ECC
Key generation output for ZSK-ECC
Each key should have a unique label that will be used to refer to the private key in the next steps.
-
List the keys using the
p11tool2command.
|
›_ Console |
|---|
|
List key output in slot 1