将定制密钥库用于 Liberty 标记配置文件
另请参见
如果要使用 Liberty 标记配置文件来实现应用程序的安全,则必须执行本主题提供的配置步骤以避免在运行时出现任何失败。
将定制密钥库用于 Liberty 标记配置文件:
- 在“服务”窗口中,如果应用服务器正在运行,请停止该服务器的运行。
- 通过执行以下操作,导出 amserver 别名的证书:
- 导航至 application-server-installation-directory\domains\domain1\config 目录。
如果在安装 IDE 的过程中没有接受访问管理器的缺省配置,则必须导航至在您手动配置过程中指定的平面文件目录。
- 在此目录中,找到 keystore.jks 文件。
- 使用以下 keytool 命令导出 amserver 别名的证书:
keytool -export -keystore keystore.jks -alias amserver -rfc -file server.cer
此命令会自动将 x509 证书保存到名为 server.cer 的文件中。
- 存储在 amflatfiledir 中的 keystore.jks 文件的口令为 secret。
- 通过执行以下操作,导出 Web 服务客户端对 SOAP 消息进行签名时使用的定制密钥别名的证书:
- 导航至定制密钥库所在的目录。
- 使用以下 keytool 命令导出定制密钥别名的证书:
keytool -export -keystore customkeystore.jks -alias key-alias -rfc -file client.cer
此命令会自动将 X509 证书保存到名为 client.cer 的文件中。
在步骤 6 的 com.sun.identity.liberty.wsc.cert.alias 属性中,您将使用相同的别名。
- 要导入这些证书,请执行以下操作:
- 使用以下 keytool 命令,在定制密钥库文件中导入在步骤 2 中创建的 server.cer:
keytool -import -keystore customkeystore.jks -alias amdisco -file server.cer
使用定制密钥库的 Web 服务提供方使用此导入的证书以信任 Access Manager Liberty 发现服务。
- 使用以下 keytool 命令,在 Access Manager 密钥库文件中导入在步骤 3 中创建的 client.cer:
keytool -import -keystore keystore.jks -alias custom-alias -file client.cer
有关 Access Manager 密钥库文件的位置,请参见步骤 2。
搜索服务将使用此导入证书来生成 Web 服务客户端的标记。
- 存储在 amflatfiledir 中的 keystore.jks 文件的口令为 secret。
- 导航至 application-server-installation-directory\addons\amserver 目录,然后打开 AMConfig.properties 文件。
- 找到以下行:
com.sun.identity.liberty.ws.wsc.certalias=amclient
将其更改为:
com.sun.identity.liberty.ws.wsc.certalias=alias-of-the-private-key-in-the-custom-keystore
alias-of-the-private-key-in-the-custom-keystore 是在上面的步骤 3 中使用的 key-alias。
使用 Liberty X509/SAML 配置文件的 Web 服务客户端将使用此证书对 SOAP 消息进行签名。
- 找到以下行:
com.sun.identity.liberty.ws.trustedca.certaliases=amserver:host-name
将其更改为:
com.sun.identity.liberty.ws.trustedca.certaliases=amdisco:host-name
- amdisco 是步骤 4 中导入证书时使用的别名。
- 如果没有更改缺省安装值,则上面一行中的 host-name 将为 localhost。
- 保存所做的更改并关闭 AMConfig.properties 文件。
- 在“服务”窗口中,重新启动应用服务器。
- 另请参见
- 为 Sun Java System Access Manager 实例配置安全机制配置文件
- 为 Liberty SAML 标记配置文件提供配置支持
- “编辑 <安全机制> 配置文件”对话框
- 为 Web 服务客户端启用 Liberty 安全机制
- 为 Web 服务提供方启用 Liberty 安全机制
法律声明