Sun Java System Portal Server Secure Remote Access 7.2 管理指南

certadmin 脚本

您可使用 certadmin 脚本完成以下证书管理任务:

生成自签名证书

您需要为每个服务器与网关之间的 SSL 通信生成证书。

Procedure在安装后生成自签名证书

  1. 以超级用户身份,在您要为其生成证书的网关机器上运行 certadmin 脚本:


    portal-server-install-root/SUNWportal/bin/certadmin -n gateway-profile-name
    

    显示证书管理菜单。


    1) Generate Self-Signed Certificate
    2) Generate Certificate Signing Request (CSR)
    3) Add Root CA Certificate
    4) Install Certificate From Certificate Authority (CA)
    5) Delete Certificate
    6) Modify Trust Attributes of Certificate (e.g., for PDC)
    7) List Root CA Certificates
    8) List All Certificates
    9) Print Certificate Content
    10) Quit
    choice: [10]
    1
    
  2. 选择证书管理菜单上的选项 1

    证书管理脚本询问您是否要保留现有数据库文件。

  3. 输入组织特定信息、令牌名和证书名。


    注 –

    对于通配符证书,在主机的全限定 DNS 名中指定一个 *。例如,如果主机的全限定 DNS 名为 abc.sesta.com,则将其指定为 *.sesta.com。现在,生成的证书对 sesta.com 域中的所有主机名均有效。



    What is the fully-qualified DNS name of this host? [host_name.domain_name]
    What is the name of your organization (ex: Company)? []
    What is the name of your organizational unit (ex: division)? []
    What is the name of your City or Locality? []
    What is the name (no abbreviation please) of your State or Province? []
    What is the two-letter country code for this unit? []
    Token name is needed only if you are not using the default internal 
    (software) cryptographic module, for example, if you want to use a crypto card 
    (Token names could be listed using:
    modutil -dbdir /etc/opt/SUNWportal/cert/gateway-profile-name -list);
    Otherwise, just hit Return below.
    Please enter the token name. []
    Enter the name you like for this certificate?
    Enter the validity period for the certificate (months) [6]
    A self-signed certificate is generated and the prompt returns.

    令牌名(默认值为空)和证书名存储在 /etc/opt/SUNWportal/cert/ gateway-profile-name 下面的 .nickname 文件中。

  4. 重新启动网关以使证书生效:


    ./psadmin start-sra-instance -u amadmin -f passwordfile -N profilename -t gateway

生成证书签名请求 (CSR)

需先生成包含 CA 所需信息的证书签名请求,方可从 CA 定购证书。

Procedure生成 CSR

  1. 以超级用户身份,运行 certadmin 脚本:


    portal-server-install-root/SUNWportal/bin/certadmin -n gateway-profile-name
    

    显示证书管理菜单。


    1) Generate Self-Signed Certificate
    2) Generate Certificate Signing Request (CSR)
    3) Add Root CA Certificate
    4) Install Certificate From Certificate Authority (CA)
    5) Delete Certificate
    6) Modify Trust Attributes of Certificate (e.g., for PDC)
    7) List Root CA Certificates
    8) List All Certificates
    9) Print Certificate Content
    10) Quit
    choice: [10]
    2
    
  2. 选择证书管理菜单上的选项 2

    脚本会提示您输入组织特定信息、令牌名以及 Web 站点管理员的电子邮件和电话号码。

    确保指定主机的全限定 DNS 名。


    What is the fully-qualified DNS name of this host? [snape.sesta.com]
    What is the name of your organization (ex: Company)? []
    What is the name of your organizational unit (ex: division)? []
    What is the name of your City or Locality? []
    What is the name (no abbreviation please) of your State or Province? []
    What is the two-letter country code for this unit? []
    Token name is needed only if you are not using the default internal 
    (software) cryptographic module, 
    for example, if you want to use a crypto card 
    (Token names could be listed using: 
    modutil -dbdir /etc/opt/SUNWportal/cert -list);
    Otherwise, just hit Return below.
    Please enter the token name []
    Now input some contact information for
    the webmaster of the machine that the certificate 
    is to be generated for.
    What is the email address of the admin/webmaster for this server [] ?
    What is the phone number of the admin/webmaster for this server [] ?
  3. 键入全部所需信息。


    注 –

    请勿将 Web 站点管理员的电子邮件和电话号码留为空白。此信息对于获取有效 CSR 是必需的。


    会产生 CSR 并将其存储在 portal-server-install-root /SUNWportal/bin/csr.hostname.datetimestamp 文件中。CSR 也会打印在屏幕上。当您从 CA 定购证书时,可直接复制并粘贴 CSR。

添加根 CA 证书

如果客户机站点所提交的经 CA 签名的证书不为网关证书数据库所知,则 SSL 握手将会失败。

为防止出现此情况,您需要向证书数据库中添加根 CA 证书。这将确保使 CA 为网关所知。

浏览到 CA 的 Web 站点并获取该 CA 的根证书。当您使用 certadmin 脚本时,要指定根 CA 证书的文件名和路径。

Procedure添加根 CA 证书

  1. 以超级用户身份,运行 certadmin 脚本。


    portal-server-install-root/SUNWportal/bin/certadmin -n gateway-profile-name
    

    显示证书管理菜单。


    1) Generate Self-Signed Certificate
    2) Generate Certificate Signing Request (CSR)
    3) Add Root CA Certificate
    4) Install Certificate From Certificate Authority (CA)
    5) Delete Certificate
    6) Modify Trust Attributes of Certificate (e.g., for PDC)
    7) List Root CA Certificates
    8) List All Certificates
    9) Print Certificate Content
    10) Quit
    choice: [10]
    3
    
  2. 选择证书管理菜单上的选项 3

  3. 输入包含根证书的文件名,并输入证书名。

    根 CA 证书会被添加到证书数据库。

安装来自证书授权机构的 SSL 证书

在安装网关过程中,默认情况下将创建并安装自签名证书。在安装之后,您可随时安装由供应商(提供官方证书授权机构 (CA) 服务)或您公司的 CA 签名的 SSL 证书。

此项任务涉及三个步骤:

从 CA 定购证书

在生成证书签名请求 (CSR) 后,您需要使用 CSR 从 CA 定购证书。

Procedure从 CA 定购证书

  1. 转到证书授权机构的 Web 站点,并定购您的证书。

  2. 提供 CA 所需的 CSR。提供 CA 所需的其他信息(如果需要)。

    您会收到来自 CA 的证书。将其保存到文件中。在文件中需包括连同证书在内的 "BEGIN CERTIFICATE" 和 "END CERTIFICATE" 行。

    以下示例省略了实际的证书数据。


    -----BEGIN CERTIFICATE-----
    The certificate contents...
    ----END CERTIFICATE-----

安装来自 CA 的证书

使用 certadmin 脚本,在 /etc/opt/SUNWportal/cert/ gateway-profile-name 下的本地数据库文件中安装从 CA 获取的证书。

Procedure安装来自 CA 的证书

  1. 以超级用户身份,运行 certadmin 脚本。


    portal-server-install-root/SUNWportal/bin/certadmin -n gateway-profile-name
    

    显示证书管理菜单。


    1) Generate Self-Signed Certificate
    2) Generate Certificate Signing Request (CSR)
    3) Add Root CA Certificate
    4) Install Certificate From Certificate Authority (CA)
    5) Delete Certificate
    6) Modify Trust Attributes of Certificate (e.g., for PDC)
    7) List Root CA Certificates
    8) List All Certificates
    9) Print Certificate Content
    10)Quit
    choice: [10]
    4
    
  2. 选择证书管理菜单上的选项 4

    脚本要求您输入证书文件名、证书名和令牌名。


    What is the name (including path) of file that contains the certificate?
    Please enter the token name you used when creating CSR for this certificate. []
  3. 提供全部所需的信息。

    证书被安装在 /etc/opt/SUNWportal/cert/gateway-profile-name 中,并且返回屏幕提示。

  4. 重新启动网关以使证书生效:


    ./psadmin start-sra-instance -u amadmin -f passwordfile -N profilename -t gateway

删除证书

通过使用证书管理脚本可删除证书。

Procedure删除证书

  1. 以超级用户身份,运行 certadmin 脚本。


    portal-server-install-root/SUNWportal/bin/certadmin -n

    其中,gateway-profile-name 是网关实例名。

    显示证书管理菜单。


    1) Generate Self-Signed Certificate
    2) Generate Certificate Signing Request (CSR)
    3) Add Root CA Certificate
    4) Install Certificate From Certificate Authority (CA)
    5) Delete Certificate
    6) Modify Trust Attributes of Certificate (e.g., for PDC)
    7) List Root CA Certificates
    8) List All Certificates
    9) Print Certificate Content
    10)Quit
    choice: [10]
    5
    
  2. 选择证书管理菜单上的选项 5

  3. 输入要删除证书的名称。

修改证书的信任属性

证书的信任属性需要修改的一种情况便是,同时使用客户机验证和网关。PDC(个人数字证书)是客户机验证的一个示例。签发 PDC 的 CA 必须要受网关委托,并且必须将 CA 证书标记为 "T" 以满足 SSL。

如果安装网关与 HTTPS 站点进行通信,则 HTTPS 站点服务器证书的 CA 必须要受网关委托,并且必须将 CA 证书标记为 "C" 以满足 SSL。

Procedure修改证书的信任属性

  1. 以超级用户身份,运行 certadmin 脚本。


    gateway-install-root/SUNWportal/bin/certadmin -n
    gateway-profile-name
    

    其中,gateway-profile-name 是网关实例名。

    显示证书管理菜单。


    1) Generate Self-Signed Certificate
    2) Generate Certificate Signing Request (CSR)
    3) Add Root CA Certificate
    4) Install Certificate From Certificate Authority (CA)
    5) Delete Certificate
    6) Modify Trust Attributes of Certificate (e.g., for PDC)
    7) List Root CA Certificates
    8) List All Certificates
    9) Print Certificate Content
    10)Quit
    choice: [10]
    6
    
  2. 选择证书管理菜单上的选项 6

  3. 输入证书名。例如,Thawte Personal Freemail CA。


    Please enter the name of the certificate?
    Thawte Personal Freemail CA
  4. 输入证书的信任属性。


    Please enter the trust attribute you want the 
    certificate to have [CT,CT,CT]

    证书信任属性将被更改。

列出根 CA 证书

通过使用证书管理脚本可查看所有根 CA 证书。

Procedure查看根 CA 的列表

  1. 以超级用户身份,运行 certadmin 脚本。


    portal-server-install-root/SUNWportal/bin/certadmin -n
    gateway-profile-name
    

    其中,gateway-profile-name 是网关实例名。

    显示证书管理菜单。


    1) Generate Self-Signed Certificate
    2) Generate Certificate Signing Request (CSR)
    3) Add Root CA Certificate
    4) Install Certificate From Certificate Authority (CA)
    5) Delete Certificate
    6) Modify Trust Attributes of Certificate (e.g., for PDC)
    7) List Root CA Certificates
    8) List All Certificates
    9) Print Certificate Content
    10)Quit
    choice: [10]
    7
    
  2. 选择证书管理菜单上的选项 7

    显示所有根 CA 证书。

列出所有证书

通过使用证书管理脚本可查看所有证书及其相应的信任属性。

Procedure列出所有证书

  1. 以超级用户身份,运行 certadmin 脚本。


    portal-server-install-root
    /SUNWportal/bin/certadmin -n
    gateway-profile-name
    

    其中,gateway-profile-name 是网关实例名。

    显示证书管理菜单。


    1) Generate Self-Signed Certificate
    2) Generate Certificate Signing Request (CSR)
    3) Add Root CA Certificate
    4) Install Certificate From Certificate Authority (CA)
    5) Delete Certificate
    6) Modify Trust Attributes of Certificate (e.g., for PDC)
    7) List Root CA Certificates
    8) List All Certificates
    9) Print Certificate Content
    10)Quit
    choice: [10]
    8
    
  2. 选择证书管理菜单上的选项 8

    显示所有 CA 证书。

打印证书

通过使用证书管理脚本可打印证书。

Procedure打印证书

  1. 以超级用户身份,运行 certadmin 脚本。


    portal-server-install-root/SUNWportal/bin/certadmin -n
     gateway-profile-name
    

    其中,gateway-profile-name 是网关实例名。

    显示证书管理菜单。


    1) Generate Self-Signed Certificate
    2) Generate Certificate Signing Request (CSR)
    3) Add Root CA Certificate
    4) Install Certificate From Certificate Authority (CA)
    5) Delete Certificate
    6) Modify Trust Attributes of Certificate (e.g., for PDC)
    7) List Root CA Certificates
    8) List All Certificates
    9) Print Certificate Content
    10)Quit
    choice: [10]
    9
    
  2. 选择证书管理菜单上的选项 9

  3. 输入证书名。