AdminTask 对象的 PersonalCertificateCommands 命令组

要通过 wsadmin 工具配置安全性,可以使用 Jython 或 Jacl 脚本编制语言来实现。 PersonalCertificateCommands 组中的命令和参数可用于创建和管理个人证书或签署者证书。

避免麻烦: 当运行时尝试使用带有嵌入引号的证书别名时,这些别名可能会导致问题。 请勿在证书别名中嵌入引号。

createChainedCertificate

createChainedCertificate 命令创建新的自签名证书并将该证书存储在密钥库中。
避免麻烦: 要使用 IBMi5OSKeyStore 密钥库,请在创建新证书之前验证密钥库中是否存在链的每个部分的签署者。 在创建新证书之前,必须将该签署者导入到 IBMi5OSKeyStore 密钥库中。

目标对象

无。

必需参数

-keyStoreName
指定唯一地标识密钥库配置对象的名称。 (字符串,必需)
-certificateAlias
指定唯一地标识密钥库中证书请求的名称。 (字符串,必需)
-certificateSize
指定证书的大小。 (整数,必需)
-certificateCommonName
指定证书的公共名。 (字符串,必需)
-certificateOrganization
指定证书的组织。 (字符串,可选)

可选参数

-rootCertificateAlias
指定唯一名称以标识要用于签名的根证书。 缺省的根证书别名为 root。 (字符串,可选)
-certificateVersion
指定证书的版本。 (字符串,可选)
-keyStoreScope
指定密钥库的作用域名称。 (字符串,可选)
-certificateOrganization
指定证书的组织。 (字符串,可选)
-certificateOrganizationalUnit
指定证书的组织单元。 (字符串,可选)
-certificateLocality
指定证书的位置。 (字符串,可选)
-certificateState
指定证书的状态。 (字符串,可选)
-certificateZip
指定证书的邮政编码。 (字符串,可选)
-certificateCountry
指定证书的国家或地区。 (字符串,可选)
-certificateValidDays
指定证书有效的时间量(以天计)。 (整数,可选)
[9.0.5.5 or later]-keyUsage
指定要包括在证书中的密钥用法证书扩展。 有效值为 digital_signaturenon_repudiationkey_enciphermentdata_enciphermentencipher_onlydecipher_only。 (字符串,可选)
[9.0.5.5 or later]-extendedKeyUsage
指定要包括在证书中的扩展密钥用法证书扩展。 有效值为 ServerAuth_IdClientAuth_IdCodeSigning_Id EmailProtection_IdIPSecEndSystem_IdIPSecTunnel_IdIPSecUser_IdTimeStamping_Id。 (字符串,可选)
[9.0.5.5 or later]-sanDNSName
指定主题备用名称的服务器的 DNS 名称,通常与 CN 值相同。 (字符串,可选)
[9.0.5.5 or later]-sanEmail
指定要包括在主题备用名称扩展名中的电子邮件地址值。 (字符串,可选)
[9.0.5.5 or later]-sanIPAddress
指定要包括在主题备用名称扩展名中的 IP 地址值。 (字符串,可选)

返回值

此命令不会返回输出。

示例

批处理方式示例用法

  • 使用 Jython 字符串:
    AdminTask.createChainedCertificate('-keyStoreName myKeystore -certificateAlias 
    newCertificate -certificateSize 10 -certificateCommonName localhost 
    -certificateOrganization ibm')
  • 使用 Jython 列表:
    AdminTask.createChainedCertificate('-keyStoreName', 'myKeystore', '-certificateAlias', 
    'newCertificate', '-certificateSize', '10', '-certificateCommonName', 'localhost', 
    '-certificateOrganization', 'ibm')

交互方式示例用法

  • 使用 Jython:
    AdminTask.createChainedCertificate('-interactive')

createSelfSignedCertificate

createSelfSignedCertificate 命令在密钥库中创建自签名个人证书。

目标对象

无。

必需参数

-keyStoreName
唯一地标识密钥库配置对象的名称。 (字符串,必需)
-certificateAlias
唯一地标识密钥库中证书请求的名称。 (字符串,必需)
-certificateVersion
证书的版本。 (字符串,必需)
-certificateSize
证书的大小。 (整数,必需)
-certificateCommonName
证书的公共名。 (字符串,必需)

可选参数

-keyStoreScope
密钥库的作用域名称。 (字符串,可选)
-certificateOrganization
证书的组织。 (字符串,可选)
-certificateOrganizationalUnit
证书的组织单位。 (字符串,可选)
-certificateLocality
证书的位置。 (字符串,可选)
-certificateState
证书状态。 (字符串,可选)
-certificateZip
证书的邮政编码。 (字符串,可选)
-certificateCountry
证书的国家或地区。 (字符串,可选)
-certificateValidDays
证书有效的时间量(以天计)。 (整数,可选)
-signatureAlgorithem
签名算法用于创建自签名证书。 可以使用 listSignatureAlgorithms 命令来检索有效签名算法的列表。 (字符串,可选)

椭圆曲线签名算法要求特定大小,因此如果已指定 SHA256withECDSA、SHA384withECDSA 或 SHA512withECDSA,那么将忽略大小参数。 SHA256withECDSA、SHA384withECDSA 和 SHA512withECDSA 对应的大小分别为 256、384 和 512。

如果未提供签名算法,那么使用 SHA256withRSA。

[9.0.5.5 or later]-keyUsage
指定要包括在证书中的密钥用法证书扩展。 有效值为 digital_signaturenon_repudiationkey_enciphermentdata_enciphermentencipher_onlydecipher_only
[9.0.5.5 or later]-extendedKeyUsage
指定要包括在证书中的扩展密钥用法证书扩展。 有效值为 ServerAuth_IdClientAuth_IdCodeSigning_Id EmailProtection_IdIPSecEndSystem_IdIPSecTunnel_IdIPSecUser_IdTimeStamping_Id
[9.0.5.5 or later]-sanDNSName
指定主题备用名称的服务器的 DNS 名称,通常与 CN 值相同。
[9.0.5.5 or later]-sanEmail
指定要包括在主题备用名称扩展名中的电子邮件地址值。
[9.0.5.5 or later]-sanIPAddress
指定要包括在主题备用名称扩展名中的 IP 地址值。

示例输出

此命令不会返回输出。

示例

批处理方式示例用法:

  • 使用 Jacl:
    $AdminTask createSelfSignedCertificate {-keyStoreName testKeyStore -certificateAlias 
    default -certificateCommonName localhost -certificateOrganization ibm}
  • 使用 Jython 字符串:
    AdminTask.createSelfSignedCertificate('[-keyStoreName testKeyStore -certificateAlias 
    default -certificateCommonName localhost -certificateOrganization ibm')
  • 使用 Jython 列表:
    AdminTask.createSelfSignedCertificate(['-keyStoreName', 'testKeyStore', '-certificateAlias', 
    'default', '-certificateCommonName', 'localhost', '-certificateOrganization', 'ibm]')

交互方式示例用法:

  • 使用 Jython:
    AdminTask.createSelfSignedCertificate('-interactive')

deleteCertificate

deleteCertificate 命令从密钥库中删除个人证书。 该命令将该证书的副本保存在删除密钥库中。

目标对象

无。

必需参数

-keyStoreName
唯一地标识密钥库配置对象的名称。 (字符串,必需)
-certificateAlias
唯一地标识密钥库中证书请求的名称。 (字符串,必需)

可选参数

-keyStoreScope
密钥库的作用域名称。 (字符串,可选)

示例输出

此命令不会返回输出。

示例

交互方式示例用法:

  • 使用 Jython:
    AdminTask.deleteCertificate('-interactive')

exportCertificate

exportCertificate 命令将个人证书从一个密钥库导出到另一个密钥库。

目标对象

无。

必需参数

-keyStoreName
唯一地标识密钥库配置对象的名称。 (字符串,必需)
-keyStorePassword
密钥库的密码。 (字符串,必需)
-keyFilePath
位于文件系统中的密钥库文件的完整路径。 将导入或导出证书的密钥库。 (字符串,必需)
-keyFilePassword
密钥库文件的密码。 (字符串,必需)
-keyFileType
密钥文件的类型。 (字符串,必需)
-certificateAlias
唯一地标识密钥库中证书请求的名称。 (字符串,必需)

可选参数

-keyStoreScope
密钥库的作用域名称。 (字符串,可选)
-aliasInKeyStore
(字符串,可选)

示例输出

此命令不会返回输出。

示例

交互方式示例用法:

  • 使用 Jython:
    AdminTask.exportCertificate('-interactive')

exportCertToManagedKS

exportCertToManagedKS 命令将个人证书导出到配置中的受管密钥库。

目标对象

无。

必需参数

-keyStoreName
指定唯一地标识密钥库配置对象的名称。 (字符串,必需)
-keyStorePassword
密钥库的密码。 (字符串,必需)
-toKeyStoreName
指定要将证书导出到其中的密钥库的唯一名称。 (字符串,必需)
-certificateAlias
指定相关证书的别名。 (字符串,必需)

可选参数

-keyStoreScope
指定相关证书的密钥库。 (字符串,可选)
-toKeyStoreScope
指定要导出到其中的密钥库的作用域。 (字符串,可选)
-aliasInKeyStore
指定用于标识密钥库中证书的别名。 (字符串,可选)

返回值

此命令不会返回输出。

批处理方式示例用法

  • 使用 Jython 字符串:
    AdminTask.exportCertificateToManagedKS('-keyStoreName myKS -keyStorePassword myKSpw 
    -toKeyStoreName myKS2 -certificateAlias testingKeyStore')
  • 使用 Jython 列表:
    AdminTask.exportCertificateToManagedKS(['-keyStoreName', 'myKS', '-keyStorePassword', 
    'myKSpw', '-toKeyStoreName', 'myKS2', '-certificateAlias', 'testingKeyStore'])

交互方式示例用法

  • 使用 Jython:
    AdminTask.exportCertificateToManagedKS('-interactive')

extractCertificate

extractCertificate 命令将个人证书的签署者部分抽取到证书文件中。 稍后,可以将该文件中的证书添加至密钥库以建立信任。

目标对象

无。

必需参数

-keyStoreName
唯一地标识密钥库配置对象的名称。 (字符串,必需)
-certificateAlias
唯一地标识密钥库中证书请求的名称。 (字符串,必需)
-certificateFilePath
包含证书的请求文件的完整路径。 (字符串,必需)
-base64Encoded
如果证书属于基本 64 位 (Base64) 编码的 ASCII 文件类型,请将此参数的值设置为 true。 如果证书是二进制文件,请将此参数的值设置为 false。 (布尔值,必需)

可选参数

-keyStoreScope
密钥库的作用域名称。 (字符串,可选)

示例输出

此命令不会返回输出。

示例

批处理方式示例用法:

  • 使用 Jacl:
    [Windows]
    $AdminTask extractCertificate {-keyStoreName testKeyStore -certificateFilePath 
    c:/temp/CertFile.arm -certificateAlias testCertificate}
    [Linux][AIX][z/OS][HP-UX][IBM i][Solaris]
    $AdminTask extractCertificate {-keyStoreName testKeyStore -certificateFilePath 
    /temp/CertFile.arm -certificateAlias testCertificate}
  • 使用 Jython 字符串:
    [Windows]
    AdminTask.extractCertificate('[-keyStoreName testKeyStore -certificateFilePath 
    c:/temp/CertFile.arm -certificateAlias testCertificate]')
    [Linux][AIX][z/OS][HP-UX][IBM i][Solaris]
    AdminTask.extractCertificate('[-keyStoreName testKeyStore -certificateFilePath 
    /temp/CertFile.arm -certificateAlias testCertificate]')
  • 使用 Jython 列表:
    [Windows]
    AdminTask.extractCertificate(['-keyStoreName', 'testKeyStore', '-certificateFilePath', 
    'c:/temp/CertFile.arm', '-certificateAlias', 'testCertificate'])
    [Linux][AIX][z/OS][HP-UX][IBM i][Solaris]
    AdminTask.extractCertificate(['-keyStoreName', 'testKeyStore', '-certificateFilePath', 
    '/temp/CertFile.arm', '-certificateAlias', 'testCertificate'])

交互方式示例用法:

  • 使用 Jython:
    AdminTask.extractCertificate('-interactive')
[9.0.5.5 或更高版本]

genAndReplaceCertificates

genAndReplaceCertificates 命令会创建一个新的个人证书,并用它代替现有证书。 新的个人证书可以具有与原证书不同的属性,但保留原个人证书的 SubjectDN。

个人证书生成可以处理一个个人证书,提供的密钥库中的所有个人证书或配置中的所有 SSL 密钥库。 运行,生成和替换根证书的唯一方法是同时指定根证书和密钥库文件。 如果正在处理所有密钥库,那么不能仅指定根密钥库或处理根密钥库。 此命令在 RSA 密钥库上不起作用。

此命令将创建新的自签名个人证书或替换原始证书并使用根密钥库中的根进行签名的个人证书。 个人证书的 SubjectDN 保持不变,但可以根据指定的参数更改其他属性。 来自环境中个人证书的任何签署者证书都将替换为新的签署者证书。 如果要替换根证书,那么将使用新根证书重新生成使用原始根证书签名的任何证书,并且修改的属性仅适用于根证书。

如果要升级个人证书以具有新的大小,签名算法或寿命,那么可以使用此命令。 如果要向个人证书添加证书扩展信息,那么也可以使用此命令。

目标对象

无。

必需参数

无。

可选参数

-keyStoreName
指定唯一地标识密钥库配置对象的名称。 (字符串,可选)
-keyStoreScope
指定将证书导入到的密钥库的作用域。 (字符串,可选)
-keyUsage
指定要包括在证书中的密钥用法证书扩展。 有效值为 digital_signaturenon_repudiationkey_enciphermentdata_enciphermentencipher_onlydecipher_only。 (字符串,可选)
-extendedKeyUsage
指定要包括在证书中的扩展密钥用法证书扩展。 有效值为 ServerAuth_IdClientAuth_IdCodeSigning_Id EmailProtection_IdIPSecEndSystem_IdIPSecTunnel_IdIPSecUser_IdTimeStamping_Id。 (字符串,可选)
-certificateAlias
指定唯一地标识密钥库中证书请求的名称。 (字符串,可选)
-certificateSize
指定证书的大小。 (整数,可选)
[9.0.5.15 或更高版本]-certificateSubjectDN
[9.0.5.15 或更高版本]指定要生成的证书的 subjectDN 。 该参数只能与 -certificateAlias 参数一起使用。
-certificateValidDays
指定证书有效的时间量 (以天计)。 (整数,可选)
-signatureAlgorthm
指定用于创建证书或证书请求的签名算法。 (字符串,可选)
-sanDNSName
指定主题备用名称的服务器的 DNS 名称。 (字符串,可选)
-sanEmail
指定要包含在主题备用名称扩展中的电子邮件地址。 (字符串,可选)
-sanIPAddress
指定要包含在主题备用名称扩展中的 IP 地址。 (字符串,可选)

示例

使用 Jython:
  • 以下示例显示如何为 NodeDefaultKeyStore 密钥库中的 default 证书名称生成具有主题备用名称和密钥用法 serverAuthclientAuth 的新证书:
    AdminTask.genAndReplaceCertificates('[-keyStoreName NodeDefaultKeyStore -certificateAlias default -extendedKeyUsage ServerAuth_Id,ClientAuth_Id -sanDNSName myMachine.ibm.com -sanEmail myMail@host.ibm.com -sanIPAddress 127.0.0.1 ]')
  • 以下示例显示如何将配置中的所有证书替换为指定大小的新证书。 此命令不会替换根密钥库中的值。
    AdminTask.genAndReplaceCertificates('[-certificateSize 4096]')
  • 以下示例显示如何将 NodeDefaultKeyStore 密钥库中的所有证书替换为寿命为 3650 天的新证书:
    AdminTask.genAndReplaceCertificates('[-keyStoreName NodeDefaultKeyStore -certificateValidDays 3560 ]')
  • 以下示例显示如何将根证书替换为 signatureAlgorithm 值为 SHA384withRSA的新证书。 替换根证书时,配置中使用原始根签名的所有证书都将替换为使用新根签名的证书。
    AdminTask.genAndReplaceCertificates('[-keyStoreName NodeDefaultRootStore -certificateAlias root -signatureAlgorithm SHA384withRSA ]')
[9.0.5.5 或更高版本]

getCertificate

getCertificate 命令获取有关密钥库中特定个人证书的信息。 如果使用 requestCACertificate 命令创建了相关证书,那么该证书可以处于 COMPLETEREVOKED 状态。 证书请求可以处于 PENDING 状态。 使用 getCertificateRequest 命令确定证书请求是否处于 PENDING 状态。

目标对象

无。

必需参数

-keyStoreName
唯一地标识密钥库配置对象的名称。 (字符串,必需)
-certificateAlias
唯一地标识密钥库中证书请求的名称。 (字符串,必需)

可选参数

-keyStoreScope
密钥库的作用域名称。 (字符串,可选)

示例输出

该命令返回关于证书请求的信息。

示例

交互方式示例用法:

  • 使用 Jython:
    AdminTask.getCertificate('-interactive')

getCertificateChain

getCertificateChain 命令查询配置以获取有关证书链中每个个人证书的信息。

目标对象

无。

必需参数和返回值

-keyStoreName
指定存储 CA 证书的密钥库对象的名称。 使用 listKeyStores 命令来显示可用密钥库的列表。 (字符串,必需)
-certificateAlias
指定证书的唯一别名。 (字符串,必需)

可选参数

-keyStoreScope
指定密钥库的管理作用域。 对于 Deployment Manager 概要文件,缺省值为单元作用域。 对于应用程序服务器概要文件,缺省值为节点作用域。 (字符串,可选)

示例输出

该命令返回一组属性列表,它们包含有关链中每个证书的配置信息。

示例

批处理方式示例用法:

  • 使用 Jacl:
    $AdminTask getCertificateChain {-certificateAlias newCertificate 
    -keyStoreName CellDefaultKeyStore}
  • 使用 Jython 字符串:
    AdminTask.getCertificateChain('-certificateAlias newCertificate 
    -keyStoreName CellDefaultKeyStore')
  • 使用 Jython 列表:
    AdminTask.getCertificateChain(['-certificateAlias', 'newCertificate', 
    '-keyStoreName', 'CellDefaultKeyStore'])

交互方式示例用法:

  • 使用 Jython:
    AdminTask.getCertificateChain('-interactive')

importCertificate

importCertificate 命令从密钥库导入个人证书。

目标对象

无。

必需参数

-keyStoreName
唯一地标识密钥库配置对象的名称。 (字符串,必需)
-keyFilePath
位于文件系统中的密钥库文件的完整路径。 将导入或导出证书的密钥库。 (字符串,必需)
-keyFilePassword
密钥库文件的密码。 (字符串,必需)
-keyFileType
密钥文件的类型。 (字符串,必需)
-certificateAliasFromKeyFile
要从中导入证书的密钥文件中的证书别名。 (字符串,必需)
-certificateAlias
唯一地标识密钥库中证书请求的名称。 (字符串,必需)

可选参数

-keyStoreScope
密钥库的作用域名称。 (字符串,可选)

示例输出

此命令不会返回输出。

示例

交互方式示例用法:

  • 使用 Jython:
    AdminTask.importCertificate('-interactive')

importCertFromManagedKS

importCertFromManagedKS 命令从配置中受管密钥库导入个人证书。

目标对象

无。

必需参数

-keyStoreName
指定唯一地标识密钥库配置对象的名称。 (字符串,必需)
-fromKeyStoreName
指定唯一地标识系统从中导入证书的密钥库的名称。 (字符串,必需)
-fromKeyStorePassword
为系统从中导入证书的密钥库指定密码。 (字符串,必需)
-certificateAliasFromKeyStore
指定密钥库中证书的别名。 (字符串,必需)

可选参数

-keyStoreScope
指定要将证书导入到其中的密钥库的作用域。 (字符串,可选)
-fromKeyStoreScope
指定要从中导入证书的密钥库的作用域。 (字符串,可选)
-certificateAlias
为目标密钥库指定证书的别名。 (字符串,可选)

返回值

此命令不会返回输出。

批处理方式示例用法

  • 使用 Jython 字符串:
    AdminTask.importCertFromManagedKS('-keyStoreName myKeystore -fromKeyStoreName 
    oldKeystore -fromKeyStorePassword my122password -certificateAliasFromKeyStore 
    myCertificate')
  • 使用 Jython 列表:
    AdminTask.importCertFromManagedKS('-keyStoreName', 'myKeystore', '-fromKeyStoreName', 
    'oldKeystore', '-fromKeyStorePassword', 'my122password', '-certificateAliasFromKeyStore', 
    'myCertificate')

交互方式示例用法

  • 使用 Jython:
    AdminTask.importCertFromManagedKS('-interactive')

listKeySizes

listKeySizes 是管理控制台帮助程序任务,用于显示创建个人证书时允许使用的一组证书密钥大小集合。

缺省情况下,该组有效密钥大小包括 512、1024、2048、4096 和 8192。 您可以在 com.ibm.websphere.customKeySizeList 安全定制属性中定制以逗号分隔的密钥大小列表。 可以使用 setAdminActiveSecuritySettings 命令来设置 com.ibm.websphere.customKeySizeList 定制属性。

有效密钥大小必须至少为 512,但不能超过 16384,而且必须为 8 的倍数。 将忽略 com.ibm.websphere.customKeySizeList 中不满足大小要求的所有值。 如果完成处理时定制列表中不包含任何内容,那么将返回缺省大小列表。

目标对象

无。

必需参数

无。

可选参数

无。

示例输出

返回大小的 arrayList。 大小为字符串:

512
1024
2048
4096
8192

示例

批处理方式示例用法:

  • 使用 Jacl:
    $AdminTask listKeySize
  • 使用 Jython 字符串:
    AdminTask.listKeySizes()

listPersonalCertificates

listPersonalCertificates 命令列示特定密钥库中的个人证书。

目标对象

无。

必需参数

-keyStoreName
唯一地标识密钥库配置对象的名称。 此字段的值不是密钥库文件的路径。 (字符串,必需)

可选参数

-keyStoreScope
密钥库的作用域名称。 要获取密钥库作用域的列表,请参阅包含在 ManagementScopeCommands 命令组中的 listManagementScopes 命令。 (字符串,可选)

示例输出

该命令返回密钥库中每份个人证书的属性列表。

示例

批处理方式示例用法:

  • 使用 Jython 字符串:
    AdminTask.listPersonalCertificates('-keyStoreName myKS')
  • 使用 Jython 列表:
    AdminTask.listPersonalCertificates(['-keyStoreName', 'myKS'])

交互方式示例用法:

  • 使用 Jython:
    AdminTask.listPersonalCertificates('-interactive')

queryCACertificate

queryCACertificate 命令查询配置以确定 CA 是否已完成证书。 如果 CA 返回个人证书,那么系统会将该证书标记为 COMPLETE。 否则,它将保持标记为 PENDING

目标对象

无。

必需参数和返回值

-keyStoreName
指定存储 CA 证书的密钥库对象的名称。 使用 listKeyStores 命令来显示可用密钥库的列表。 (字符串,必需)
-certificateAlias
指定证书的唯一别名。 (字符串,必需)

可选参数

-keyStoreScope
指定密钥库的管理作用域。 对于 Deployment Manager 概要文件,缺省值为单元作用域。 对于应用程序服务器概要文件,缺省值为节点作用域。 (字符串,可选)

示例输出

该命令返回以下两个值之一: Certificate COMPLETEcertificate PENDING。 如果此命令返回 Certificate COMPLETE 消息,那么认证中心将返回所请求的证书,并且将替换缺省个人证书。 如果该命令返回 certificate PENDING 消息,那么认证中心尚未返回证书。

示例

批处理方式示例用法:

  • 使用 Jacl:
    $AdminTask queryCACertificate {-certificateAlias newCertificate 
    -keyStoreName CellDefaultKeyStore}
  • 使用 Jython 字符串:
    AdminTask.queryCACertificate('-certificateAlias newCertificate 
    -keyStoreName CellDefaultKeyStore')
  • 使用 Jython 列表:
    AdminTask.queryCACertificate(['-certificateAlias', 'newCertificate', 
    '-keyStoreName', 'CellDefaultKeyStore'])

交互方式示例用法:

  • 使用 Jython:
    AdminTask.queryCACertificate('-interactive')

receiveCertificate

receiveCertificate 命令将文件中的签署者证书接收到个人证书中。

目标对象

无。

必需参数

-keyStoreName
唯一地标识密钥库配置对象的名称。 (字符串,必需)
-certificateAlias
唯一地标识密钥库中证书请求的名称。 (字符串,必需)
-certificateFilePath
包含证书的文件的完整路径。 (字符串,必需)
-base64Encoded
如果证书是用 ascii 基本 64 位 (base 64) 编码的,请将此参数的值设置为 true。 如果证书是二进制文件,请将此参数的值设置为 false。 (布尔值,必需)

可选参数

-keyStoreScope
密钥库的作用域名称。 (字符串,可选)

示例输出

此命令不会返回输出。

示例

批处理方式示例用法:

  • 使用 Jacl:
    [Windows]
    $AdminTask receiveCertificate {-keyStoreName testKeyStore 
    -certificateFilePath c:/temp/CertFile.arm}
    [Linux][AIX][z/OS][HP-UX][IBM i][Solaris]
    $AdminTask receiveCertificate {-keyStoreName testKeyStore 
    -certificateFilePath /temp/CertFile.arm}
  • 使用 Jython 字符串:
    [Windows]
    AdminTask.receiveCertificate('[-keyStoreName testKeyStore 
    -certificateFilePath c:/temp/CertFile.arm]')
    [Linux][AIX][z/OS][HP-UX][IBM i][Solaris]
    AdminTask.receiveCertificate('[-keyStoreName testKeyStore 
    -certificateFilePath /temp/CertFile.arm]')
  • 使用 Jython 列表:
    [Windows]
    AdminTask.receiveCertificate(['-keyStoreName', 'testKeyStore', 
    '-certificateFilePath', 'c:/temp/CertFile.arm'])
    [Linux][AIX][z/OS][HP-UX][IBM i][Solaris]
    AdminTask.receiveCertificate(['-keyStoreName', 'testKeyStore', 
    '-certificateFilePath', '/temp/CertFile.arm'])

交互方式示例用法:

  • 使用 Jython:
    AdminTask.receiveCertificate('-interactive')

renewCertificate

renewCertificate 命令会将某个证书更新为新的已生成证书。

目标对象

无。

必需参数

-keyStoreName
指定标识密钥库的唯一名称。 (字符串,必需)
-certificateAlias
指定标识证书的唯一名称。 (字符串,必需)

可选参数

-keyStoreScope
指定密钥库的作用域。 (字符串,可选)
-deleteOldSigners
如果要在证书替换期间删除旧的签署者证书,请将此参数的值设置为 true。 否则,请将此参数的值设置为 false。 (布尔值,可选)

返回值

此命令不会返回输出。

批处理方式示例用法

  • 使用 Jython 字符串:
    AdminTask.renewCertificate('-keyStoreName myKS -certificateAlias 
    testCertificate')
  • 使用 Jython 列表:
    AdminTask.renewCertificate(['-keyStoreName', 'myKS', '-certificateAlias', 
    'testCertificate'])

交互方式示例用法

  • 使用 Jython:
    AdminTask.renewCertificate('-interactive')

replaceCertificate

replaceCertificate 命令将某个个人证书替换为另一个个人证书。 该命令查找对配置中旧的证书别名的每个引用并将该别名替换为新别名。 该命令还会将原有个人证书中的每个签署者证书替换为新的个人证书中的签署者。

目标对象

无。

必需参数和返回值

-keyStoreName
唯一地标识密钥库配置对象的名称。 (字符串,必需)
-certificateAlias
唯一地标识密钥库中证书请求的名称。 (字符串,必需)
-replacementCertificateAlias
用来替换不同证书的证书别名。 (字符串,必需)

可选参数

-keyStoreScope
密钥库的作用域名称。 (字符串,可选)
-deleteOldCert
如果要在证书替换期间删除旧的证书,请将此参数的值设置为 true。 否则,请将此参数的值设置为 false。 (布尔值,可选)
-deleteOldSigners
如果要在证书替换期间删除旧的签署者证书,请将此参数的值设置为 true。 否则,请将此参数的值设置为 false。 (布尔值,可选)

示例输出

此命令不会返回输出。

示例

批处理方式示例用法:

  • 使用 Jacl:
    $AdminTask replaceCertificate {-keyStoreName testKeyStore -certificateAlias 
    default -replacementCertificateAlias replaceCert -deleteOldCert true 
    -deleteOldSigners true}
  • 使用 Jython 字符串:
    AdminTask.replaceCertificate('[-keyStoreName testKeyStore -certificateAlias 
    default -replacementCertificateAlias replaceCert -deleteOldCert true 
    -deleteOldSigners true]')
  • 使用 Jython 列表:
    AdminTask.replaceCertificate(['-keyStoreName', 'testKeyStore', '-certificateAlias', 
    'default', '-replacementCertificateAlias', 'replaceCert', '-deleteOldCert', 
    'true', '-deleteOldSigners', 'true'])

交互方式示例用法:

  • 使用 Jython:
    AdminTask.replaceCertificate('-interactive')

requestCACertificate

requestCACertificate 命令创建证书请求并将该请求发送至认证中心 (CA)。 如果认证中心返回个人证书,那么所返回证书会替换密钥库中的证书请求。 该命令还会使用原先存在的通过 createCertificateRequest 命令创建的证书请求。 当 CA 返回个人证书时,系统会将该证书标记为 COMPLETE ,并且该命令会返回一条消息,指出该证书已完成。 如果 CA 未返回个人证书,那么系统会将证书请求标记为 PENDING ,并且该命令会返回一条消息,指示证书为 PENDING

避免麻烦: 要使用 IBMi5OSKeyStore 密钥库,请在创建新证书之前验证密钥库中是否存在链的每个部分的签署者。 在创建新证书之前,必须将该签署者导入到 IBMi5OSKeyStore 密钥库中。

目标对象

无。

必需参数和返回值

-certificateAlias
指定证书的别名。 您可以指定预定义的证书请求。 (字符串,必需)
-keyStoreName
指定存储 CA 证书的密钥库对象的名称。 使用 listKeyStores 命令来显示可用密钥库的列表。 (字符串,必需)
-caClientName
指定已创建的 CA 客户机对象的名称并引用 WSPKIClient 实现。 与 CA 服务器通信需要使用此参数。 (字符串,必需)
-revocationPassword
指定以后用于撤销证书的密码。 (字符串,必需)

可选参数

-keyStoreScope
指定密钥库的管理作用域。 对于 Deployment Manager 概要文件,缺省值为单元作用域。 对于应用程序服务器概要文件,缺省值为节点作用域。 (字符串,可选)
-caClientScope
指定 CA 客户机的管理作用域。 对于 Deployment Manager 概要文件,缺省值为单元作用域。 对于应用程序服务器概要文件,缺省值为节点作用域。 (字符串,可选)
-certificateCommonName
指定证书的完整专有名称 (DN) 的公共名 (CN) 部分。 此公共名称可以表示个人、公司或机器。 对于 Web 站点来说,公共名通常是服务器所在的 DNS 主机名。 (字符串,可选)
-certificateOrganization
指定证书的完整专有名称 (DN) 的组织部分。 (字符串,可选)
-certificateOrganizationalUnity
指定证书的完整专有名称 (DN) 的组织单元部分。 (字符串,可选)
-certificateLocality
指定证书的完整专有名称 (DN) 的位置部分。 (字符串,可选)
-certificateState
指定证书的完整专有名称 (DN) 的状态部分。 (字符串,可选)
-certificateZip
指定证书的完整专有名称 (DN) 的邮政编码部分。 (字符串,可选)
-certificateCountry
指定证书的完整专有名称 (DN) 的国家或地区部分。 (字符串,可选)
-certificateSize
指定证书密钥的大小。 有效值为 512、1024、2048、4096 和 8192。 缺省值为 2048。 (字符串,可选)

示例输出

该命令返回以下两个值之一: Certificate COMPLETEcertificate PENDING

示例

批处理方式示例用法:

  • 使用 Jacl:
    $AdminTask requestCACertificate {-certificateAlias newCertificate -keyStoreName 
    CellDefaultKeyStore -CAClientName myCAClient -revocationPassword revokeCApw}
  • 使用 Jython 字符串:
    AdminTask.requestCACertificate('-certificateAlias newCertificate -keyStoreName 
    CellDefaultKeyStore -CAClientName myCAClient -revocationPassword revokeCApw')
  • 使用 Jython 列表:
    AdminTask.requestCACertificate(['-certificateAlias','newCertificate','-keyStoreName',
    'CellDefaultKeyStore','-CAClientName','myCAClient','-revocationPassword',
    'revokeCApw'])

交互方式示例用法:

  • 使用 Jython:
    AdminTask.requestCACertificate('-interactive')

revokeCACertificate

revokeCACertificate 命令将请求发送至 CA 以撤销相关 CA 个人证书。

目标对象

无。

必需参数和返回值

-certificateAlias
指定用于标识 CA 个人证书对象的唯一名称,以及该证书在密钥库中的别名。 (字符串,必需)
-keyStoreName
指定用于存储 CA 个人证书的密钥库的名称。 (字符串,必需)
-revocationPassword
指定撤销证书所需的密码。 此密码与创建证书时提供的密码相同。 (字符串,必需)

可选参数

-keyStoreScope
指定密钥库的管理作用域。 对于 Deployment Manager 概要文件,缺省值为单元作用域。 对于应用程序服务器概要文件,缺省值为节点作用域。 (字符串,可选)
-revocationReason
指定撤销相关证书的原因。 此参数的缺省值为 unspecified。 (字符串,可选)

示例输出

此命令不会返回输出。 使用 getCertificate 命令来查看证书的当前状态,如以下示例所示:
AdminTask.getCertificate('-certificateAlias myCertificate -keyStoreName CellDefaultKeyStore')

示例

批处理方式示例用法:

  • 使用 Jacl:
    $AdminTask revokeCACertificate {-keyStoreName CellDefaultKeyStore -certificateAlias 
    myCertificate -revocationPassword pw4revoke}
  • 使用 Jython 字符串:
    AdminTask.revokeCACertificate('[-keyStoreName CellDefaultKeyStore -certificateAlias 
    myCertificate -revocationPassword pw4revoke]')
  • 使用 Jython 列表:
    AdminTask.revokeCACertificate(['-keyStoreName', 'CellDefaultKeyStore', '-certificateAlias', 
    'myCertificate', '-revocationPassword', 'pw4revoke'])

交互方式示例用法:

  • 使用 Jython:
    AdminTask.revokeCACertificate('-interactive')