AdminTask 对象的 CertificateRequestCommands 命令组
要通过 wsadmin 工具配置安全性,可以使用 Jython 或 Jacl 脚本语言来实现。CertificateRequestCommands 组中的命令和参数可用于创建和管理证书请求。
AdminTask 对象的 CertificateRequestCommands 命令组包括以下命令:
createCertificateRequest
createCertificateRequest 命令创建与特定密钥库相关联的证书请求。
目标对象
无。参数和返回值
- -keyStoreName
- 唯一地标识密钥库配置对象的名称。(字符串,必需)
- -keyStoreScope
- 密钥库的范围名称。(字符串,可选)
- -certificateAlias
- 唯一地标识密钥库中证书请求的名称。(字符串,必需)
- -certificateVersion
- 证书版本。(字符串,必需)
- -certificateSize
- (整数,必需)
- -certificateCommonName
- (字符串,必需)
- -certificateOrganization
- (字符串,可选)
- -certificateOrganizationalUnit
- (字符串,可选)
- -certificateLocality
- (字符串,可选)
- -certificateState
- 证书的状态代码。(字符串,可选)
- -certificateZip
- 证书的邮政编码。(字符串,可选)
- -certificateCountry
- 证书的国家或地区。(字符串,可选)
- -certificateValidDays
- 证书有效的时间量(以天计)。(整数,可选)
- -certificateRequestFilePath
- 可以发送到认证中心的证书请求的文件位置。(字符串,必需)
- -signatureAlgorithm
- 签名算法用于创建自签名证书。可以使用 listSignatureAlgorithms 命令来检索有效签名算法的列表。(字符串,可选)
- 返回:您创建的密钥库对象的配置对象名。
示例
批处理方式示例用法:
- 使用 Jacl:
$AdminTask createCertificateRequest {-keyStoreName testKeyStore -certificateAlias certReq -certificateSize 1024 -certificate CommonName localhost -certificate Organization testing -certificate RequestFilePath c:/temp/testCertReq.arm}
- 使用 Jython 字符串:
AdminTask.createCertificateRequest ('[-keyStoreName testKeyStore -certificateAlias certReq -certificateSize 1024 -certificate CommonName localhost -certificate Organization testing -certificate RequestFilePath c:/temp/testCertReq.arm]')
- 使用 Jython 列表:
AdminTask.createCertificateRequest (['-keyStoreName', 'testKeyStore', '-certificateAlias', 'certReq', '-certificateSize', '1024', '-certificateCommonName', 'localhost','-certificateOrganization', 'testing', '-certificateRequestFilePath','c:/temp/testCertReq.arm'])
交互方式示例用法:
- 使用 Jacl:
$AdminTask createCertificateRequest {-interactive}
- 使用 Jython 字符串:
AdminTask.createCertificateRequest ('[-interactive]')
- 使用 Jython 列表:
AdminTask.createCertificateRequest (['-interactive'])
deleteCertificateRequest
deleteCertificateRequest 命令从密钥库删除证书请求。
目标对象
无。参数和返回值
- -keyStoreName
- 唯一地标识密钥库配置对象的名称。(字符串,必需)
- -keyStoreScope
- 密钥库的范围名称。(字符串,可选)
- -certificateAlias
- 唯一地标识密钥库中证书请求的名称。(字符串,必需)
- 返回:无。
示例
批处理方式示例用法:
- 使用 Jacl:
$AdminTask deleteCertificateRequest {-keyStoreName testKeyStore -certificateAlias certReq}
- 使用 Jython 字符串:
AdminTask.deleteCertificateRequest ('[-keyStoreName testKeyStore -certificateAlias certReq]')
- 使用 Jython 列表:
AdminTask.deleteCertificateRequest (['-keyStoreName', 'testKeyStore', '-certificateAlias', 'certReq'])
交互方式示例用法:
- 使用 Jacl:
$AdminTask deleteCertificateRequest {-interactive}
- 使用 Jython 字符串:
AdminTask.deleteCertificateRequest ('[-interactive]')
- 使用 Jython 列表:
AdminTask.deleteCertificateRequest (['-interactive'])
extractCertificateRequest
extractCertificateRequest 命令将证书请求抽取到文件中。
目标对象
无。参数和返回值
- -keyStoreName
- 唯一地标识密钥库配置对象的名称。(字符串,必需)
- -keyStoreScope
- 密钥库的范围名称。(字符串,可选)
- -certificateAlias
- 唯一地标识密钥库中证书请求的名称。(字符串,必需)
- -certificateRequestFilePath
- 可以发送到认证中心的证书请求的文件位置。(字符串,必需)
可选参数
- -signatureAlgorithm
- 签名算法用于创建自签名证书。可以使用 listSignatureAlgorithms 命令来检索有效签名算法的列表。(字符串,可选)
椭圆曲线签名算法要求特定大小,因此如果已指定 SHA256withECDSA、SHA384withECDSA 或 SHA512withECDSA,那么将忽略大小参数。SHA256withECDSA、SHA384withECDSA 和 SHA512withECDSA 对应的大小分别为 256、384 和 512。
- 返回:已创建证书请求文件,该文件包含抽取的证书。
示例
批处理方式示例用法:
- 使用 Jacl:
$AdminTask extractCertificateRequest {-keyStoreName testKeyStore -certificateAlias certReq -certificateRequestFilePath c:/temp/testCertReq.arm}
- 使用 Jython 字符串:
AdminTask.extractCertificateRequest ('[-keyStoreName testKeyStore -certificateAlias certReq -certificateRequestFilePath c:/temp/testCertReq.arm]')
- 使用 Jython 列表:
AdminTask.extractCertificateRequest (['-keyStoreName', 'testKeyStore', '-certificateAlias', 'certReq', '-certificateRequestFilePath','c:/temp/testCertReq.arm'])
交互方式示例用法:
- 使用 Jacl:
$AdminTask extractCertificateRequest {-interactive}
- 使用 Jython 字符串:
AdminTask.extractCertificateRequest ('[-interactive]')
- 使用 Jython 列表:
AdminTask.extractCertificateRequest (['-interactive'])
getCertificateRequest
getCertificateRequest 命令获取关于密钥库中特定证书请求的信息。
目标对象
无。参数和返回值
- -keyStoreName
- 唯一地标识密钥库配置对象的名称。(字符串,必需)
- -keyStoreScope
- 密钥库的范围名称。(字符串,可选)
- -certificateAlias
- 唯一地标识密钥库中证书请求的名称。(字符串,必需)
- 返回:关于证书请求的信息。
示例
批处理方式示例用法:
- 使用 Jacl:
$AdminTask getCertificateRequest {-keyStoreName testKeyStore -certificateAlias certReq}
- 使用 Jython 字符串:
AdminTask.getCertificateRequest ('[-keyStoreName testKeyStore -certificateAlias certReq]')
- 使用 Jython 列表:
AdminTask.getCertificateRequest (['-keyStoreName', 'testKeyStore', '-certificateAlias', 'certReq'])
交互方式示例用法:
- 使用 Jacl:
$AdminTask getCertificateRequest {-interactive}
- 使用 Jython 字符串:
AdminTask.getCertificateRequest ('[-interactive]')
- 使用 Jython 列表:
AdminTask.getCertificateRequest (['-interactive'])
listCertificateRequests
listCertificateRequests 命令用于列示所有与特定密钥库关联的证书请求。
目标对象
无。参数和返回值
- -keyStoreName
- 唯一地标识密钥库配置对象的名称。(字符串,必需)
- -keyStoreScope
- 密钥库的范围名称。(字符串,可选)
- 返回:密钥库中每个证书请求的属性列表。
示例
批处理方式示例用法:
- 使用 Jacl:
$AdminTask listCertificateRequest {-keyStoreName testKeyStore}
- 使用 Jython 字符串:
AdminTask.listCertificateRequest ('[-keyStoreName testKeyStore]')
- 使用 Jython 列表:
AdminTask.listCertificateRequest (['-keyStoreName', 'testKeyStore'])
交互方式示例用法:
- 使用 Jacl:
$AdminTask listCertificateRequests {-interactive}
- 使用 Jython 字符串:
AdminTask.listCertificateRequests ('[-interactive]')
- 使用 Jython 列表:
AdminTask.listCertificateRequests (['-interactive'])