Sun Java System Directory Server Enterprise Edition 6.3 管理指南

Procedure导出和导入 CA 签名的服务器证书

在某些情况下,您可能需要导出证书的公钥和私钥,以便日后可以导入该证书。例如,您可能希望其他服务器使用该证书。

此过程中的命令可用于包含通配符的证书(如 "cn=*,o=example")。

可使用 DSCC 执行此任务。有关信息,请参见目录服务控制中心界面和 DSCC 联机帮助。

  1. 导出证书。


    $ dsadm export-cert [-o output-file] instance-path cert-alias
    

    例如:


    $ dsadm export-cert -o /tmp/first-certificate /local/ds1 "First Certificate"
    $ dsadm export-cert -o /tmp/first-ca-server-certificate /local/ds1/ defaultCert
    Choose the PKCS#12 file password:
    Confirm the PKCS#12 file password:
    $ ls /tmp
    first-ca-server-certificate
     
  2. 导入证书。


    $ dsadm import-cert instance-path cert-file
    

    例如,将证书导入到服务器实例:


    $ dsadm import-cert /local/ds2 /tmp/first-ca-server-certificate
    Enter the PKCS#12 file password:
     
  3. (可选的)如果已将证书导入服务器,请将该服务器配置为使用导入的证书。


    $ dsconf set-server-prop -e -h host -p port ssl-rsa-cert-name:server-cert