首页 > 数据库 > > 管理Web证书-生成证书
已安装Java。
执行以下步骤创建证书:
DMCoreWebKeystore文件的名称应与下列步骤中保持一致。
cd $DM_HOME/cert
创建证书文件夹。
mkdir DMcert打开创建的证书文件夹。
cd $DM_HOME/cert/DMcert执行以下命令创建一个keystore文件,包含待签名的秘钥对/证书:
keytool -genkey -alias <alias name> -keyalg RSA -keystore "<keystore file name>" -dname "CN=client.com,OU=Client Company,O=Client,L=CLientLocation,ST=Client State,C=Client Country Short Code"
keytool -genkey -alias DMCoreWebKeystoreCRT -keyalg RSA -keystore "./DMCoreWebKeystore" -dname "CN=DMServer, OU=GAUSSTOOLS, O=HUAWEI, L=BLR, ST=KN, C=IN"
keytool -certreq -keyalg RSA -alias <alias name> -file <csr file name> -keystore <keystore file name>
keytool -certreq -keyalg RSA -alias DMCoreWebKeystoreCRT -file ./DMCoreWebKeystore.csr -keystore "./DMCoreWebKeystore"
subjectKeyIdentifier=hash authorityKeyIdentifier=keyid:always,issuer:always # This is what PKIX recommends but some broken software chokes on critical # extensions. basicConstraints = critical,CA:true # So we do this instead. basicConstraints = CA:true keyUsage = critical,cRLSign,keyCertSign,digitalSignature,keyAgreement,keyEncipherment crlDistributionPoints=URI:http://my.com/my.arl,URI:http://oth.com/my.arl subjectAltName=IP:10.xx.xx.xxx,DNS:dmserver
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
# This is what PKIX recommends but some broken software chokes on critical
# extensions.
basicConstraints = critical,CA:true
# So we do this instead.
basicConstraints = CA:true
keyUsage = critical,cRLSign,keyCertSign,digitalSignature,keyAgreement,ketEncipherment
subjectAltName=DNS:dmserver
例如:
root (issued by = issued to) rootCertificate.crt
|
+---CA1 (issued by root = issued CA1) CA1.crt
|
+----DMServerCertificate (issued by CA1 = issued machine-name (com) or IPaddress (10.x.x.x) )
(DMCoreWebKeystore.crt) where your web page access is https://com:9190/APW/
https://10.x.x.x:9190/APW/
keytool -import -alias <alias name> -keystore "<keystore file name>" -trustcacerts -file <root certificate>
keytool -import -alias GaussToolsCA -keystore "./ DMCoreWebKeystore" -trustcacerts -file ./rootCertificate.crt
keytool -import -alias GaussToolsInternediateCA1 -keystore "<keystore file>" -trustcacerts -file <intermediate certificate>
keytool -import -alias GaussToolsInternediateCA1 -keystore "./DMCoreWebKeystore" -trustcacerts -file ./CA1.crt
如果有多个中间证书,执行上述命令逐个导入证书。
keytool -import -alias DMCoreWebKeystoreCRT -keystore "<keystore file>" -trustcacerts -file <server/domain certificate>
keytool -import -alias DMCoreWebKeystoreCRT -keystore "./DMCoreWebKeystore" -trustcacerts -file ./DMCoreWebKeystore.crt
有关证书安装的详细信息,请参见更新/替换证书。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3120395/ ,如需转载,请注明出处,否则将追究法律责任。