创建密钥并生成证书签名请求 (CSR)
您可以创建密钥对以生成证书签名请求 (CSR)。 此外,您需要密钥对来订购或请求证书,以便为 Citrix Netscaler VPX进一步配置 HSM。
-
首先,确认 VPX 中的对象列表。 在创建期间使用此分区的指定密码。
root@IBMADC690867-s6dr# cmu list Please enter password for token in slot 0 : **********
该输出结果确认不存在任何对象,因为输出结果为空。
然后,通过显示分区详细信息来验证 HSM 中的对象计数是否为
0
:[jpmongehsm2] lunash:>partition show -p partition6 Partition Name: partition6 Partition SN: 534071053 Partition Label: partition6 Partition Owner Locked Out: no Partition Owner PIN To Be Changed: no Partition Owner Login Attempts Left: 10 before Partition Owner is Locked Out Legacy Domain Has Been Set: no Partition Storage Information (Bytes): Total=207559, Used=0, Free=207559 Partition Object Count: 0 Command Result : 0 (Success)
以上示例中列出的命令使用以下语法:
partition show -p <partition_name>
-
使用 VPX中的证书管理实用程序 (CMU),使用以下示例中显示的命令创建密钥对。 再次使用指定的分区密码。
root@IBMADC690867-s6dr# cmu gen -modulusBits=2048 -publicExponent=65537 -sign=T -verify=T -label=NSkey_s6dr Please enter password for token in slot 0 : ********** Select RSA Mechanism Type - [1] PKCS [2] FIPS 186-3 Only Primes [3] FIPS 186-3 Auxiliary Primes : 1
在前面的语法中,
modulusBits
参数表示 RSA 密钥的长度(以比特为单位),而publicExponent
则定义用于生成密钥的公共指数值。publicExponent
必须设置为3
、17
或65537
。 “label”关键字用于指定一个标记,以供稍后轻松引用和识别。 有关其他两个/额外参数的更多信息,请查阅 Utilities Reference Guide。 -
确认已创建对象。 在 VPX 中:
root@IBMADC690867-s6dr# cmu list Please enter password for token in slot 0 : ********** handle=76 label=NSkey_s6dr handle=73 label=NSkey_s6dr
在 HSM 中:
[jpmongehsm2] lunash:>partition show -p partition6 Partition Name: partition6 Partition SN: 534071053 Partition Label: partition6 Partition Owner Locked Out: no Partition Owner PIN To Be Changed: no Partition Owner Login Attempts Left: 10 before Partition Owner is Locked Out Legacy Domain Has Been Set: no Partition Storage Information (Bytes): Total=207559, Used=1660, Free=205899 Partition Object Count: 2 Command Result : 0 (Success)
-
使用上一步创建的密钥,用 CMU 实用程序生成 CSR。
确保对“公共名称”(CN) 和“电子邮件”(E) 使用相应的值。 第一个与与虚拟 IP (VPX) 关联的 DNS A 记录中使用的 FQDN 匹配。 E 参数将用于在请求后发送证书采购详情。
root@IBMADC690867-s6dr# cmu requestcertificate Please enter password for token in slot 0 : ********** Enter Subject 2-letter Country Code (C) : US Enter Subject State or Province Name (S) : North Carolina Enter Subject Locality Name (L) : Durham Enter Subject Organization Name (O) : IBM Enter Subject Organization Unit Name (OU) : HSM Enter Subject Common Name (CN) : hsmclient7.projectgoldfinch.net Enter EMAIL Address (E) : user@yourdomain.com Enter output filename : certreqnss6dr.csr
不过,在列出的输出中,文件名可以是任何扩展名为 .csr 的文件,建议使用有意义的描述。
-
确认创建文件。
root@IBMADC690867-s6dr# ls certreqnss6dr.csr common multitoken server.pem ckdemo configurator openssl.cnf uninstall.sh cmu lunacm salogin vtl