kmfcfg - 密钥管理策略和插件配置实用程序
kmfcfg subcommand [option ...]
kmfcfg 命令允许用户配置密钥管理框架 (Key Management Framework, KMF) 策略数据库。KMF 策略数据库 (database, DB) 限制使用通过 KMF 框架管理的密钥和证书。
kmfcfg 提供在系统缺省数据库文件 /etc/security/kmfpolicy.xml 或用户定义数据库文件中列出、创建、修改、删除、导入和导出策略定义的能力。
对于插件配置,kmfcfg 允许用户显示插件信息、安装或卸载 KMF 插件以及修改插件选项。
支持以下子命令:
将新策略添加到策略数据库文件中。
create 子命令的格式如下:
kmfcfg create [dbfile=dbfile] policy=policyname [ignore-date=true|false] [ignore-unknown-eku=true|false] [ignore-trust-anchor=true|false] [ignore-cert-revoke-responder-timeout=true|false] [cert-revoke-responder-timeout=timeout in seconds] [trust-intermediate-cas=true|false] [max-cert-path-length=max length in cert path] [validity-adjusttime=adjusttime] [ta-name=trust anchor subject DN | search] [ta-serial=trust anchor serial number] [http-proxy=URL] [http-proxy-none=true|false] [ocsp-responder=URL] [ocsp-proxy=URL] [ocsp-use-cert-responder=true|false] [ocsp-response-lifetime=timelimit] [ocsp-ignore-response-sign=true|false] [ocsp-responder-cert-name=Issuer DN] [ocsp-responder-cert-serial=serial number] [crl-basefilename=basefilename | search] [crl-directory=directory] [crl-get-crl-uri=true|false] [crl-proxy=URL] [crl-ignore-crl-sign=true|false] [crl-ignore-crl-date=true|false] [bypass-ipsec-policy=true|false] [keyusage=digitalSignature | nonRepudiation | keyEncipherment | dataEncipherment | keyAgreement | keyCertSign | cRLSign | encipherOnly | decipherOnly],[...] [ekunames=serverAuth | clientAuth | codeSigning | emailProtection | ipsecEndSystem | ipsecTunnel | ipsecUser | timeStamping | OCSPSigning],[...] [ekuoids=OID,OID,OID...] [mapper-name=name of the mapper] [mapper-dir=dir where mapper library resides] [mapper-path=full pathname of mapper library] [mapper-options=mapper options]
create 子命令支持以下选项:
以秒为单位设置等待 CRL 或 OCSP 响应者时的最大超时值。缺省值为 30 秒。最大超时值为 300 秒。
这两个属性用于指定 CRL 文件的位置。crl-basefilename 属性表示 CRL 文件的基文件名。crl-directory 属性表示 CRL 文件的目录,缺省为当前目录。当使用了值 search 而不是明确的 CRL 文件名时,KMF 将在指定的 CRL 目录下搜索所有有效的 CRL 文件,以查看要验证的证书是否已撤销。
If the crl-get-crl-uri attribute is set to true and the crl-basefilename is not specified, the basefilename for the cached CRL file is the basename of the URI used to fetch the CRL file.
If the crl-get-crl-uri attribute is set to false the crl-basefilename needs to be specified to indicate an input CRL file or all possible CRL files under a CRL directory by the search value.The setting for crl-get-crl-uri is false by default.
这两个属性只适用于基于文件的 CRL 插件。当前基于文件的 CRL 插件为 file 和 pkcs11 Keystore。
配置是否将动态提取和高速缓存 CRL 文件作为证书验证的一部分,使用来自证书的分发点扩展的 URI 信息。
此属性的缺省值为 false。
如果 crl-ignore-crl-date 设置为 true,不会检查 CRL 的有效时间段。
此属性的缺省值为 false。
如果 crl-ignore-crl-sign 设置为 true,不会检查 CRL 的签名。
此属性的缺省值为 false。
crl-get-crl-uri 设置为 true 时,设置代理服务器名称和端口以便动态检索 CRL 文件。此值优先于全局 http-proxy 值。
端口号为可选。如果未指定端口号,缺省值为 8080。An example crl-proxy setting might be: crl-proxy=webcache.example.com:8080.
添加新策略的 DB 文件。如果未指定,缺省值将是系统 KMF 策略数据库文件 /etc/security/kmfpolicy.xml。
正在定义的策略所需的以逗号分隔的扩展密钥使用 OID 列表。OID 以点记法表示,例如 1.2.3.4。An example ekuoids setting might be: ekuoids=1.2.3.4,9.8.7.6.5.
正在定义的策略所需的以逗号分隔的扩展密钥使用名称列表。The list of values allowed for EKUNAMES are: serverAuth, clientAuth, codeSigning, emailProtection, ipsecEndSystem, ipsecTunnel, ipsecUser, timeStamping, and OCSPSigning
缺省情况下,OCSP、CRL、密钥使用和扩展密钥使用检查处于关闭状态。要启用其中任何一个,请为特定检查指定一个或多个属性。例如,如果设置了 ocsp-responder 属性,则会启用 OCSP 检查。如果设置了 ekuname 属性或 ekuoids 属性,则会启用扩展密钥使用检查。
设置代理服务器名称和端口以便联系 CRL、OCSP 的服务器或下载证书。
端口号为可选。如果未指定端口号,则缺省值为 8080。An example crl-proxy setting might be: crl-proxy=webcache.example.com:8080.
Define the behavior after a cert-revoke-responder-timeout expiration occurs.缺省值为 false,意味着如果 cert-revoke-responder-timeout 中定义的时间到期,证书验证随即失败。否则,如果值为 true,则证书验证会绕过 CRL 和/或 OCSP 检查,继续沿着验证所需执行的一系列步骤朝下一步推进。
为此策略设置 "Ignore Date"(忽略日期)选项。缺省情况下此值为 false。如果指定了 true,策略会在评估证书有效性时忽略证书中定义的有效期。
为此策略设置 "Ignore Trust Anchor"(忽略信任锚)选项。缺省情况下此值为 false。如果指定了 true,策略不会在验证时使用信任锚证书验证主题证书的签名。
为策略设置 "Ignore Unknown EKU"(忽略未知 EKU)选项。缺省情况下此值为 false。如果为 true,策略会忽略扩展密钥使用扩展中任何无法识别的 EKU 值。
正在定义的策略所需的以逗号分隔的扩展密钥使用列表。The list of values allowed are: digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign, encipherOnly, decipherOnly
These four options support the certificate to name mapping. mapper-name provides the name of the mapper.For example, the name “cn” represents the mapper object kmf_mapper_cn.so.1. mapper-dir overrides the default mapper directory /lib/crypto. mapper-path specifies the full path to the mapper object. mapper-options is an ASCII-only string of a maximum of 255 bytes long.Its format is mapper specific but mappers are expected to accept a comma separated list of options, for example casesensitive,ignoredomain. mapper-path and mapper-name are mutually exclusive. mapper-dir can be set only if mapper-name is set. mapper-options can be set only if mapper-name or mapper-path is set.尝试使用上述任何一个不正确设置都会导致错误,且无法修改策略数据库。
指定证书链中允许的最大证书长度。缺省值为 32。
如果该属性设置为 true,则不会验证 OCSP 响应的签名。缺省情况下此值为 false。
为 OCSP 设置代理服务器名称和端口。端口号为可选。如果未指定端口号,则缺省值为 8080。An example ocsp-proxy setting might be: ocsp-proxy="webcache.example.com:8080"
此值优先于全局 http-proxy 值。
设置响应必须处于的有效时间段。timelimit 可由数字-day、数字-hour、数字-minute 或数字-second 指定。An example ocsp-response-lifetime setting might be:ocsp-response-lifetime=6-hour.
这两个属性表示 OCSP 响应者证书。ocsp-responder-cert-name 用于指定证书的签发者名称。有关示例,请参见 ta-name 选项。The ocsp-responder-cert-serial is for the serial number and must be specified as a hex value, for example, 0x0102030405060708090a0b0c0d0e0f.如果 OCSP 响应者与证书的签发者不同,并且如果需要验证 OCSP 响应,应该提供 OCSP 响应者证书信息。
设置 OCSP 响应者 URL 以便与 OCSP 验证方式一起使用。For example, ocsp-responder=http://ocsp.example.com/ocsp/status
将此策略配置为始终使用证书自身中定义的响应者(如果可能)。
要创建的策略记录。policyname 是必需的。
ta-name 标识用于验证证书的信任锚。KMF 策略引擎不会执行完全 PKIX 路径验证,而只会将信任锚视为要验证的证书的父证书。
如果指定了显式“主题 DN”,它必须与ta-serial 值结合,以便唯一地标识要使用的证书。此外,标识的证书必须可用于选择的 keystore 中。
如果使用了值 search 而不是显式主题和序列号,KMF 策略引擎会尝试查找与待验证证书的签发者名称匹配的证书并使用其进行验证。
如果使用 search,会忽略 ta-serial 值。
如果将 ta-name 指定为显式主题名称,则此证书的序列号必须由ta-serial 值指示。此序列号必须以十六进制格式表示,例如 ta-serial=0x01020a0b。
如果此策略设为 trust intermediate,则信任链的根可以是一个中间 CA 证书。缺省情况下此值为 false。指定了 true 时,如果链未固定到某个 TA 证书,则证书验证将在部分链上进行。
为证书有效期的两个端点设置调整时间。时间可由数字-day、数字-hour、数字-minute 或数字-second 指定。An example validity-adjusttime setting might be: validity-adjusttime=6-hour. ta-name="Subject DN" ta-serial=serialNumber
这两个属性表示信任锚证书,用于查找 keystore 中的信任锚证书。ta-name用于指定信任锚证书主题名称的标识名。For example, ta-name="O=Oracle Corporation, OU=Solaris Security Technologies Group, L=Ashburn, ST=VA, C=US, CN=John Smith".The ta-serial is to specify the serial number of the TA certificate.The serial number must be specified as a hex value, for example, 0x0102030405060708090a0b0c0d0e.它和“签发者 DN”一起用于查找 keystore 中的 TA 证书。The trust anchor attributes need to be set if the value of ignore-trust-anchor attribute is false.
删除与指定策略名称匹配的任何策略。无法删除系统缺省策略 (default)。
delete 子命令的格式如下:
kmfcfg delete [dbfile=dbfile] policy=policyname
delete 子命令支持以下选项:
从指定文件中读取策略定义。If dbfile is not specified, the default is the system KMF policy database file: /etc/security/kmfpolicy.xml.
要删除的策略的名称。如果使用系统数据库,则需要 policyname。
将策略从一个策略数据库文件导出到另一个策略数据库文件。
export 子命令的格式如下:
kmfcfg export policy=policyname outfile=newdbfile [dbfile=dbfile]
export 子命令支持以下选项:
从中读取导出策略的 DB 文件。如果未指定 dbfile,缺省值将是系统 KMF 策略数据库文件:/etc/security/kmfpolicy.xml。
在其中存储导出策略的 DB 文件。
要导出的策略记录。
显示关于 kmfcfg 命令的帮助。
help 子命令的格式如下:
kmfcfg help
将策略从一个策略数据库文件导入到另一个策略数据库文件。
import 子命令的格式如下:
kmfcfg import policy=policyname infile=inputdbfile [dbfile=dbfile]
import 子命令支持以下选项:
添加新策略的 DB 文件。如果未指定,缺省值将是系统 KMF 策略数据库文件 /etc/security/kmfpolicy.xml。
要从中读取策略的 DB 文件。
要导入的策略记录。
如果不指定参数,将列出缺省系统数据库中的所有策略定义。
list 子命令的格式如下:
kmfcfg list [dbfile=dbfile] [policy=policyname]
list 子命令支持以下选项:
从指定文件读取策略定义。如果未指定,缺省值将是系统 KMF 策略数据库文件 /etc/security/kmfpolicy.xml。
只显示指定策略的策略定义。
修改与指定名称匹配的任何策略。无法修改系统缺省策略 (default)。
modify 子命令的格式如下:
kmfcfg modify [dbfile=dbfile] policy=policyname [ignore-date=true|false] [ignore-unknown-eku=true|false] [ignore-trust-anchor=true|false] [ignore-cert-revoke-responder-timeout=true|false] [cert-revoke-responder-timeout=timeout in seconds] [trust-intermediate-cas=true|false] [max-cert-path-length=max length in cert path] [validity-adjusttime=adjusttime] [ta-name=trust anchor subject DN] [ta-serial=trust anchor serial number] [http-proxy=URL] [http-proxy-none=true|false] [ocsp-responder=URL] [ocsp-proxy=URL] [ocsp-use-cert-responder=true|false] [ocsp-response-lifetime=timelimit] [ocsp-ignore-response-sign=true|false] [ocsp-responder-cert-name=Issuer DN] [ocsp-responder-cert-serial=serial number] [ocsp-none=true|false] [crl-basefilename=basefilename | search]] [crl-directory=directory] [crl-get-crl-uri=true|false] [crl-proxy=URL] [crl-ignore-crl-sign=true|false] [crl-ignore-crl-date=true|false] [crl-none=true|false] [bypass-ipsec-policy=true|false] [keyusage=digitalSignature | nonRepudiation | keyEncipherment | dataEncipherment | keyAgreement | keyCertSign | cRLSign | encipherOnly | decipherOnly],[...] [keyusage-none=true|false] [ekunames=serverAuth | clientAuth | codeSigning | emailProtection | ipsecEndSystem | ipsecTunnel | ipsecUser | timeStamping | OCSPSigning],[...] [ekuoids=OID,OID,OID] [eku-none=true|false] [mapper-name=name of the mapper] [mapper-dir=dir where mapper library resides] [mapper-path=full pathname of mapper library] [mapper-options=mapper options]
modify 子命令支持与 create 子命令相同的许多选项。For descriptions of shared options, see the create subcommand.
modify 子命令支持以下唯一选项:
如果 crl-none 设置为 true,将禁用 CRL 检查。如果此属性设置为 true,则无法设置其他 CRL 属性。
要修改策略的数据库文件。如果未指定,缺省值将是系统 KMF 策略数据库文件 /etc/security/kmfpolicy.xml。
如果 eku-none 设置为 true,将禁用扩展密钥使用检查。如果 eku-none 设置为 true,无法同时设置扩展密钥使用属性ekuname 和 ekuoids。
如果 keyusage-none 设置为 true,将禁用密钥使用检查。
如果此属性设置为 true,无法同时设置 keyusage 属性。
如果 http-proxy-none 设置为 true,则全局 http-proxy 重置为无代理。
如果 bypass-ipsec-policy 设置为 true,则 KMF 指示的网络连接将尝试绕过全局 IPsec 策略。此操作需要 sys_ip_config 特权。如果没有此特权,仍将尽力尝试建立连接。
如果 ocsp-none 设置为 true,将禁用 OCSP 检查。如果此属性设置为 true,不会同时设置任何其他 OCSP 属性。
要修改的策略的名称。policyname 是必需的。无法修改系统 KMF 策略数据库中的 default 策略。
将插件安装到系统中。modulepath 字段指定 KMF 插件共享库目标文件的路径名。如果未将 pathname 指定为绝对路径名,共享库目标文件会假定为与 /lib/security/$ISA/ 相对。The ISA token is replaced by an implementation defined directory name which defines the pathname relative to the calling program's instruction set architecture.
显示 KMF 插件信息。
不使用 plugin 关键字,kmfcfg list 会如“子命令”部分所述显示策略信息。
修改 plugin 选项。plugin 选项是由插件定义的,并且由此插件专门解释,因此此命令接受任何选项字符串。
不使用 plugin 关键字,kmfcfg modify 会如“子命令”部分所述更新策略配置。
卸载具有 keystore_name 的插件。
以下示例会在系统数据库中创建一个名为 IPSEC 的新策略:
$ kmfcfg create dbfile=ipsec.xml policy=IPSEC \ ignore-trust-anchor=true \ ocsp-use-cert-responder=true \ keyusage=keyAgreement,keyEncipherment,dataEncipherment \ ekunames=ipsecTunnel,ipsecUser
将返回以下退出值:
成功完成。
出现错误。
缺省系统策略数据库
有关下列属性的说明,请参见 attributes(7):
|
The bypass-ipsec-policy, cert-revoke-responder-timeout, http-proxy, http-proxy-none, ignore-cert-revoke-responder-timeout, max-cert-path-length, and trust-intermediate-cas attributes were added in Oracle Solaris 11.2.0.
The mapper-dir, mapper-name, mapper-path, and mapper-options attributes were added in Solaris 11.0.
Plugin support, including the install, list plugin, modify plugin, and uninstall subcommands, was added in Solaris 11.0.
The kmfcfg command and all other subcommands & attributes were added in Solaris 10 8/07 (Update 4).